Java Reference
In-Depth Information
♦ Either a condition expression is not present or
V
is [un]assigned after the con-
dition expression when false.
♦
V
is [un]assigned before every
break
statement for which the
for
statement is the
break target.
•
V
is [un]assigned before the initialization part of the
for
statement iff
V
is
[un]assigned before the
for
statement.
•
V
is definitely assigned before the condition part of the
for
statement iff
V
is defin-
itely assigned after the initialization part of the
for
statement.
•
V
is definitely unassigned before the condition part of the
for
statement iff all of the
following conditions hold:
♦
V
is definitely unassigned after the initialization part of the
for
statement.
♦ Assuming
V
is definitely unassigned before the condition part of the
for
state-
ment,
V
is definitely unassigned after the contained statement.
♦ Assuming
V
is definitely unassigned before the contained statement,
V
is def-
initely unassigned before every
continue
statement for which the
for
statement is
the continue target.
•
V
is [un]assigned before the contained statement iff either of the following is true:
♦ A condition expression is present and
V
is [un]assigned after the condition ex-
pression when true.
♦ No condition expression is present and
V
is [un]assigned after the initialization
part of the
for
statement.
•
V
is [un]assigned before the incrementation part of the
for
statement iff
V
is
[un]assigned after the contained statement and
V
is [un]assigned before every
con-
tinue
statement for which the
for
statement is the continue target.
16.2.12.1. Initialization Part of for Statement
• If the initialization part of the
for
statement is a local variable declaration state-
ment, the rules of §
16.2.4
apply.
• Otherwise, if the initialization part is empty, then
V
is [un]assigned after the initial-
ization part iff
V
is [un]assigned before the initialization part.
• Otherwise, three rules apply:
♦
V
is [un]assigned after the initialization part iff
V
is [un]assigned after the last
expression statement in the initialization part.
♦
V
is [un]assigned before the first expression statement in the initialization part
iff
V
is [un]assigned before the initialization part.