Beginner · Lesson 4 of 12
Operators & expressions
An expression produces a value. Arithmetic operators combine numbers, and comparison operators answer questions. Parentheses make the intended order explicit and help the reader follow a calculation.
Try it for yourself
Run the example, then change one thing and see what happens.
Main.javaYour ideas, in code.
Loading your editor…
Run your code to see the output here.
Ready to buildUTF-86 lines
Expected output
40
Make it your own
Calculate the total cost of three items priced at 12 each.
A quick check
Which habit helps when learning operators & expressions?