Check out example codes for "java modulus". It will help you in understanding the concepts better.

Code Example 1

Java has one important arithmetical operator you may not be familiar
with, %, also known as the modulus or remainder operator.
The % operator returns the remainder of two numbers.
For instance:
* 10 % 3 => 1 because 10 divided by 3 leaves a remainder of 1

Learn ReactJs, React Native from akashmittal.com