Solution: Arithmetic Operations
This program prints three math results using System.out.println(...).
Java starts running in
main.Each
printlnevaluates the expression inside the parentheses, then prints the answer.
Code
System.out.println(5 + 7 + 3);→ prints15System.out.println(6 * 8);→ prints48System.out.println(20 / 2.0);→ prints10.0
(2.0makes the division decimal-style)
Solution: Arithmetic Operations
This program prints three math results using System.out.println(...).
Java starts running in
main.Each
printlnevaluates the expression inside the parentheses, then prints the answer.
Code
System.out.println(5 + 7 + 3);→ prints15System.out.println(6 * 8);→ prints48System.out.println(20 / 2.0);→ prints10.0
(2.0makes the division decimal-style)