// Label block and break
public class BreakAsGoto{
public static void main(String[] args) {
aBlock:
{
bBlock:
{
cBock:
{
System.out.println("Before using break");
if (true) {
break Bblock;
}
System.out.println("This will never execute");
}
System.out.println("This is never execute");
}
System.out.println("This will be executed");
}
}
}
Output:Before using break
This will be executed