What is the output?
public class Main { public static void main(String[] args) { System.out.println("a"); lab1: { int i = 10; System.out.println("b"); if (i == 10) break lab1; } System.out.println("c"); lab2: { int i = 10; if (i == 10) break lab1; } System.out.println("d"); } }
lab2: { int i = 10; if (i == 10) break lab1;// A compile-time error. }
lab1 cannot be used here because the block is not associated with lab1 label.