分类: Java
2010-07-15 12:46:59
Hist:
1007015, draft
Some statements contain other statements as part of their structure, such other statements are substatements of the statement. We say that statement S immediately contains statement U if there is no statement T different from S and U such that S contains T and T contains U.
Normal and Abrupt Completion of Statements
If all the steps are carried out as described, with no indication of abrupt completion, the statement is said to complete normally. Otherwise, complete abruptly.
Blocks
A block is a sequence of statements, local class declarations and local variable declaration statements within braces.
Local Class Declarations
A local class is a nested class that is not a member of any class and that has a name. It is a compile-time error if a local class declaration contains any one of the following access modifiers: public, protected, private, or static.
Statements
The Empty Statement
Labeled Statements
Expression Statements
The if Statement
The assert Statement
An assertion is a statement containing a boolean expression. An assertion is either enabled or disabled. If enabled, an error is reported if the expression evaluates to false. If disabled, evalutation has no effect whatsoever.
The switch Statement
The while Statement
The do Statement
The for Statement
two forms, basic and enhanced:
BasicForStatement:
for ( ForInitopt ; Expressionopt ; ForUpdateopt ) Statement
EnhancedForStatement:
for ( VariableModifiersopt Type Identifier: Expression) Statement
The break Statement
The continue Statement
The return Statement
The throw Statement
The synchronized Statement
A synchronized statement acquires a mutual-exclusion lock on behalf of the executing thread, executes a block, then release the lock.
The try Statement
Unreachable Statement
REF
1. JLS 3nd