Java Reference
In-Depth Information
static int oops() throws Exception {
throw new Exception("oops");
}
}
This program produces the output:
java.lang.Exception: oops, id=1
because the assignment of 3 to id is not executed.
15.7.5. Evaluation Order for Other Expressions
The order of evaluation for some expressions is not completely covered by these general
rules, because these expressions may raise exceptional conditions at times that must be spe-
cified. See the detailed explanations of evaluation order for the following kinds of expres-
sions:
• class instance creation expressions (§ 15.9.4 )
• array creation expressions (§ 15.10.1 )
• method invocation expressions (§ 15.12.4 )
• array access expressions (§ 15.13.1 )
• assignments involving array components (§ 15.26 )
15.8. Primary Expressions
Primary expressions include most of the simplest kinds of expressions, from which all oth-
ers are constructed: literals, class literals, field accesses, method invocations, and array ac-
cesses. A parenthesized expression is also treated syntactically as a primary expression.
Primary:
PrimaryNoNewArray
ArrayCreationExpression
PrimaryNoNewArray:
Literal
Type . class
void . class
this
ClassName . this
( Expression )
ClassInstanceCreationExpression
FieldAccess
Search WWH ::




Custom Search