Definition:
Expression statements are expressions that can be used as statements by simply adding a semicolon. When they are executed the value of the expression is evaluated.
The expressions that can be made into statements:
- use the increment (++) and decrement (--) unary operators.
- assign values to variables.
- call object methods.
- create objects.
Examples:
//assigning a value
number = 42;
//using the increment operator
number++;
//using the decrement operator
--number;
//calling a method
System.out.println("Is " + number + " the answer to the Ultimate Question of Life, the Universe and Everything?");
//creating an object
Universe realityOne = new Universe(42);

