Nested break continue

suggest change

It’s possible to break / continue to an outer loop by using label statements:

outerloop:
for(...) {
    innerloop:
    for(...) {
        if(condition1)
            break outerloop;

        if(condition2)
            continue innerloop; // equivalent to: continue;
    }
}

A label’s only use in Java is as the target of break or continue.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents