You know math. Java almost knows math. Today's lesson is about the "almost" — and these four warm-ups will show you exactly where your calculator and Java are about to disagree.
Both values are ints. What does this print? (Trust nothing.)
System.out.println(7 / 2);
% gives the remainder after dividing. What does this print?
System.out.println(7 % 2);
What does 2 + 3 * 4 evaluate to in Java?
One piece of this line is invisible to the compiler — it never executes. Click that piece.