Home » java » Continue Statement

Continue Statement

Continue statement can used with iteration statement (for,while,do while).
In for statement continue transfer the control to updation of loop variable. In while and do while statement continue transfer control to condition of the loop.

Example

When value of i is 5 then continue statement is executed and control is transferred to beginning of loop and counter variable i is incremented by one.

When i==5 then continue statement is executed and no other statement followed by continue is executed

Result

Continue with label

Whenever continue is used with label then control is transferred to beginning of label.

Result

Please follow and like us:
error