An expression is a way of describing a value.
The simplest expressions are literals, in which the value is explicitly written. For example,
25is a literal representing the int value 25.
25.0is a literal representing the double value 25.
trueis a literal representing the boolean true condition
"Hello"is a literal representing the 5-character String value Hello.
Almost equally simple are variables which have
been assigned a value. For example,
x might be a variable, the
type of which is given in some previous declaration.
Numeric literals and variables may be combined into arithmetic
expressions, for example,
Boolean literals and variables may be combined into boolean
expressions, for example
Certain arithmetic expressions result in boolean values, for example
and these may be incorporated into boolean expressions. Boolean expressions
are used as conditions.
Expressions involving objects may result in any type of value, depending on the expression.