after a break statement, the flow is forward.
The continue Statement
A
continue
statement is used within loops to end execution of the current iteration and proceed to the
next iteration. Thus, it provides a method of skipping the remaining statements in that iteration after
the continue statement.
Please note that a continue statement should be used only in loop
constructs and not in selective control constructs. Also note that using a continue statement in
selective control constructs results in a compilation error.
Continue Statement Syntax
continue;
In a while loop.
The program jumps to the
Boolean expression
at the top of the loop. If the expression
is still true, the next iteration begins.
In a do-while loop
. The program jumps to the
boolean expression
at the bottom of the loop, which
determines whether the next iteration will begin.
In a for loop
. Causes the
update expression (i.e., increment/decrement part of the for loop)
to be
executed and then the test expression is evaluated.
The continue statement should be used sparingly because, like the break statement, it also
Do'stlaringiz bilan baham: |