What is the output of the following code.
public class Main{ public static void main(String[] args) { outer: for(int i=0; i< 3; i++) { for(int j=0; j<3; j++) { System.out.println("j="+j); break outer; } } } }
j=0
public class Main{ public static void main(String[] args) { outer://from w w w. j av a 2 s.c om for(int i=0; i< 3; i++) { for(int j=0; j<3; j++) { System.out.println("j="+j); break outer; } } } }
break with label will jump to the label.