Program Layout
Condition execution
if(condition) { ... } else { ... }
Conditional Loops
while(condition) { .... }
do{ ... } while(condition);
Two kinds of for : Iteration
Multiway Branching : switch
for loop inherited from C.
for ( init; cond; update;) { ... }
Second type of for loop
for(type x : a)
{
//do something with x
}
The loop variable MUST be declared in local scope for this version of for.
int x;
for( x : a) //error . should be for(int x:a)
{
//do
}