Best way to break out of nested loops

Pages: 12
I'm assuming in code like this:
1
2
3
4
5
6
while (condition A) {
    while (condition B) {
        break while;
    }
    // ...
}

Java will break out of the innermost matching structure (in this case, the nested while loop) and there's no easy way to break out of an outer one when an inner one matches?
It works like that:
1
2
3
4
5
6
7
outer:
while (condition A) {
    while (condition B) {
        break outer;
    }
    // ...
}
Yes, MiiNiPaa shows the correct syntax used by Java.
Topic archived. No new replies allowed.
Pages: 12