how to break outer loop in java

Solutions on MaxInterview for how to break outer loop in java by the best coders in the world

showing results for - "how to break outer loop in java"
Perrine
12 Oct 2016
1public class Test {
2    public static void main(String[] args) {
3        outerloop:
4        for (int i=0; i < 5; i++) {
5            for (int j=0; j < 5; j++) {
6                if (i * j > 6) {
7                    System.out.println("Breaking");
8                    break outerloop;
9                }
10                System.out.println(i + " " + j);
11            }
12        }
13        System.out.println("Done");
14    }
15}
16