Loops
Loops
STATEMENT
Over view
• Loops statement
• Jumping statement
Loops statement
• Java do while loop executes the statement first and then checks
for the condition . Other than that it is similar to the while loop.
• The difference lies in the fact that if the condition is true at the
starting of the loop the statements would still be executed,
however in case of while loop it would not be executed at all.
Syntax:
do{
//code to be executed / loop body
//update statement
}while (condition);
Flow chart do while
JUMPING STATEMENT
break statement
continue statement
Break Statement
• Break Statement is a loop control statement that is used to
terminate the loop. With in the loops to break the loop
execution based on some condition.
• Inside labelled blocks to break that block execution based on
some condition.
CONTINUE STATEMENT