Java Reference
In-Depth Information
If such an event occurs, then execution of one or more statements may be terminated before
all steps of their normal mode of execution have completed; such statements are said to
complete abruptly .
An abrupt completion always has an associated reason , which is one of the following:
• A break with no label
• A break with a given label
• A continue with no label
• A continue with a given label
• A return with no value
• A return with a given value
• A throw with a given value, including exceptions thrown by the Java Virtual
Machine
The terms “complete normally” and “complete abruptly” also apply to the evaluation of
expressions (§ 15.6 ) . The only reason an expression can complete abruptly is that an excep-
tion is thrown, because of either a throw with a given value (§ 14.18 ) or a run-time exception
or error (§11, § 15.6 ) .
If a statement evaluates an expression, abrupt completion of the expression always causes
the immediate abrupt completion of the statement, with the same reason. All succeeding
steps in the normal mode of execution are not performed.
Unless otherwise specified in this chapter, abrupt completion of a substatement causes the
immediate abrupt completion of the statement itself, with the same reason, and all succeed-
ing steps in the normal mode of execution of the statement are not performed.
Unless otherwise specified, a statement completes normally if all expressions it evaluates
and all substatements it executes complete normally.
14.2. Blocks
A block is a sequence of statements, local class declarations, and local variable declaration
statements within braces.
Block:
{ BlockStatements opt }
BlockStatements:
BlockStatement
Search WWH ::




Custom Search