Language syntax

Java labeled continue

Skip the remainder of an enclosing labeled loop iteration. In a basic for loop this transfers to its update step.

Formal Syntax & Structure

java syntaxjava
continue label;

Working Example

Example Snippetjava
public class Main {    public static void main(String[] args) {        rows:        for (int row = 0; row < 2; row++) {            for (int col = 0; col < 3; col++) {                if (col == 1) { continue rows; }                System.out.println(row + ":" + col);            }        }    }}
Java Reference