Expressions
There's a lengthy chapter in the Java Language Specification on expressions, covering many cases that would be interesting only to language lawyers. What it boils down to is that an expression is any of the alternatives shown in Table 7-2.
Table 7-2. Expressions in Java
Expression |
Example of expression |
---|---|
A literal |
|
this object reference |
|
A field access |
|
A method call |
|
An object creation |
|
An array creation |
|
An array access |
|
Any expression connected by operators |
|
Any expression in parens |
|
You evaluate an expression, to get a result that will be:
-
A variable (as in ...
Get Just Java™ 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.