To use modulo in Java, you have to use the percent symbol %.
For instance,
int x = 2;
int y = 2;
System.out.println(x%y) will print 0 to the screen.
9.3m questions
12.0m answers