Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to choose between two types of int in java?
How to choose between two types of int in java?
Java? There are division operation (/) and remainder operation (%) in.

If two ints are divided, take the divisible part and ignore the remainder;

If it is the remainder of two ints, take the remainder and ignore the whole division.

For example:

Public? Static electricity Invalid? main(String[]? args)? {

int? m? =? 5;

int? n? =? 2;

System.out.println ("separable:"? +? (m? /? n)); ? //? The result is? 2

System.out.println ("remainder:"? +? (m? %? n)); ? //? The result is? 1

}