Labeled continue and break statements must be inside the loop that
has the same label name; otherwise, the code will not compile.
the above statment is copied for K&B.
public class
Test {
public static void main(
String[] args) {
label1:{
if(1 > 0){
break label1;
}
System.out.println("main...");
}
}
}
this code works fine.
in the above sample,label2 is not associated with loop.
Please explain how it is compiling.