1. There are 3 types of loop control statements in Java, namely While,do ... while and for loops.
2. While loop in the form :
While (boolean-expression)
{
//code to be executed
}
3. Do...while cycle, the new type is :
Do
{
//code to be executed
}
while (boolean expression);
4. The difference between while and Do...while: if the first judgement of a Boolean expression is false, then the while loop does not execute once, and the Do...while loop executes once. If the Boolean expression evaluates to True for the first time, then the while loop is equivalent to the Do...while loop.
5. For Loop (one of the most used loops), in the form:
For (variable initialization; condition judgment; stepping)
{
//code to be executed
}
the execution process for the FOR loop:
1) perform variable initialization.
2) perform the condition judgment. If the condition determines that the result is false, exit the for loop, start executing the code after the loop, or, if the condition is true, execute the code inside the For loop.
3) perform stepping.
4) Repeat step 2
JAVA 1.7 Process Control Statement cont.