⏰ 5 minutes DO NOW · 1.1.3

🧮 Java Does Math Differently

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.

1Prediction: divisionTO DO

Both values are ints. What does this print? (Trust nothing.)

System.out.println(7 / 2);
2Prediction: the % operatorTO DO

% gives the remainder after dividing. What does this print?

System.out.println(7 % 2);
3Order of operationsTO DO

What does 2 + 3 * 4 evaluate to in Java?

4What does the compiler skip?TO DO

One piece of this line is invisible to the compiler — it never executes. Click that piece.


    
✅ FOUR FOR FOUR — you already found today's three traps: dropped decimals, remainders, and precedence.
Eyes up front — the lesson takes each one further (including how to CRASH a program with division).
Mr. Babb · AP Computer Science A · Paul Public Charter School