Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
If true
If false
End
2. For loop in Java
Java for loop is a concise version of while loop, it provides the user to write
the whole condition, i.e. initialization, condition and increment/decrement
in one line.
The Syntax of Java for Loop
for (initialization condition; testing condition; increment/decrement
{
statements (s)
}
A for loop in java is also an entry controlled loop,
First we initialize the variables in use and then the condition is tested, and accordingly,
increment or decrement takes place.
Increment/
Decrement
If true
Condition
Initialization Checking Statement
START
If false
END
3. Do While Loop in Java
A do while statement is an exit controlled loop,
It checks the condition after the execution of the loop. It means that the
body of the loop is executed once if the condition is true or false.
If true
Condition
START Statement Checking
If false
END