continue statement

The continue statement is a control directive that causes immediate execution of the next iteration of the enclosing for or while loop.

Usage

The general form of the continue statement is

// ...within a while or for statement
// and often guarded by some condition
continue;

Description

Execution

Within a for or while statement the continue directive can be used to skip to the next iteration of the enclosing for or while statement without executing the rest of the current block.

Notes

  • Java's 'labelled' continue directive is not supported. The continue directive operates on the directly enclosing for or while statement.

See also