Nested break continue
suggest changeIt’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;
}
}
There is no other use for labels in Java.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents