The Java programming language provides operators that perform addition, subtraction, multiplication, and division.
...
The Arithmetic Operators.
Operator | Description |
---|---|
+ | Additive operator (also used for String concatenation) |
- | Subtraction operator |
* | Multiplication operator |
/ | Division operator |
What does '%' mean in Java?
modulus: An operator that works on integers and yields the remainder when one number is divided by another. In Java it is denoted with a percent sign(%).
What does %3 mean in Java?
% is the Modulus operator. For Java Modulus: "% Modulus - Divides left hand operand by right hand operand and returns remainder" For example: 10 % 3 is equal to 1.