对于嵌套循环,当我continue与标签一起使用时,它会在编译期间给我一个错误,说the declared loop is not present.
特别是在这种情况下,显示的错误消息是:Second is not a loop label.
这是我为演示我的问题而编写的一段代码:
//using break as a form of GOTO
class demo
{
public static void main(String [] args)
{
boolean b=false;
First:{
Second:{
Third:{
System.out.println("Before BReak");
if(b)
continue Third;
else
break Second;
}
System.out.println("THis won't execute");
}
System.out.println("THis too won't Execute");
}
}
}