The Department of Computer Science & Engineering
|
|
STUART C. SHAPIRO: CSE
115 C
|
if (condition) block
See primitivedemo.BoardFrame()
if (condition) block
else block
See primitivedemo.IntFunction.solicitIntInRange(int i, int j)
if (condition) block
else if (condition) block
...
else block
while loopswhile (condition) block
do block while (condition);
Equivalent toblock
while (condition) block
for loopsfor (initialization; condition; increment) blockNote: The scope of variables declared in the{initialization; while (condition) { block increment}}
initialization part is the entire for
statement, including the block.