Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

what does % do in java

10 % 3
10 - 3 = 7    // Start by subtracting the right hand side of the % operator
7 - 3 = 4     // Continue subtraction on remainders
4 - 3 = 1
Now you can't subtract 3 from 4 without going negative so you stop.
You have 1 leftover as a remainder so that is your answer.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java
ADD COMMENT
Topic
Name
1+8 =