boolean t = true;
first:
{
second:
{
third:
{
System.out.println("Before the break");
if (t) {
break second;
}
System.out.println("This wont execute");
}
System.out.println("Neither this one");
}
System.out.println("this will execute");
}
在代码中,“first”之前和“third”之前显示警告:标签first/third从未被显式引用。 你能告诉我为什么显示这个警告吗?
最佳答案
那只是因为您从未在代码中引用它们
正如您所提到的第二个
,如下
if(t) break second;
关于java - 警告 : The label [number] is never explicitly referenced,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22943551/