The continue statement can be used to restart a while, do-while, for, or label statement.
When we use continue without a label, it terminates the current iteration of the innermost enclosing while, do-while or for statement and continues execution of the loop with the next iteration. In contrast to the break statement, continue does not terminates the execution of the loop entirely. In a while loop, it jumps back to the conditions. In a for loop, it jumps to the increment-expression.
When you use continue with a label, it applies to the looping statements identified with that label.
The syntax of the continue statement looks like the following:
1. continue
2. continue label
|