Java Reference
In-Depth Information
•
x
is an array instance creation expression;
y
is a dimension expression, but not the
first; and
V
is [un]assigned after the dimension expression to the left of
y
.
•
x
is an array instance creation expression initialized via an array initializer;
y
is the
array initializer in
x
; and
V
is [un]assigned after the dimension expression to the
left of
y
.
16.2. Definite Assignment and Statements
16.2.1. Empty Statements
•
V
is [un]assigned after an empty statement (§
14.6
) iff it is [un]assigned before the
empty statement.
16.2.2. Blocks
• A blank
final
member field
V
is definitely assigned (and moreover is not definitely
V
and before the declaration of any class declared within the scope of
V
.
• A local variable
V
is definitely unassigned (and moreover is not definitely as-
signed) before the block that is the body of the constructor, method, instance ini-
tializer or static initializer that declares
V
.
• Let
C
be a class declared within the scope of
V
. Then
V
is definitely assigned be-
fore the block that is the body of any constructor, method, instance initializer, or
static initializer declared in
C
iff
V
is definitely assigned before the declaration of
C
.
Note that there are no rules that would allow us to conclude that
V
is definitely
unassigned before the block that is the body of any constructor, method, in-
stance initializer, or static initializer declared in
C
. We can informally conclude
that
V
is not definitely unassigned before the block that is the body of any
constructor, method, instance initializer, or static initializer declared in
C
, but
there is no need for such a rule to be stated explicitly.
•
V
is [un]assigned after an empty block iff
V
is [un]assigned before the empty
block.
•
V
is [un]assigned after a non-empty block iff
V
is [un]assigned after the last state-
ment in the block.
•
V
is [un]assigned before the first statement of the block iff
V
is [un]assigned before
the block.