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.
5.7m questions
7.4m answers