Practice

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   hear noise   go to next page

Answer:

-23 - 3

The first minus sign is "negation" and the second minus sign is "subtraction". The spaces in the expression emphasize the different roles, but are not necessary. The following expression is equivalent:

-23-3

Practice

Examine the following expressions. Assume that each variable has already been correctly declared. Decide if the expression is correct, then click on the button.

Expression Correct or Not Correct?Expression Corrector Not Correct?
25 25 - value
2( a - b ) (a-b) * (c-d)
A - b/c + D -sum + partial
( (x+y) / z ) / ( a - b ) ( (m - n) + (w-x-z) / (p % q )

 

QUESTION 3:

Are arithmetic expressions the only kind of expression?