我有这部分代码给我带来了麻烦:
Iterator localIterator1;
label75:
Iterator localIterator2;
if (str1 != null)
{
localIterator1 = localArrayList.iterator();
boolean bool = localIterator1.hasNext();
j = 0;
if (bool)
break label136;
if (j == 0)
{
localIterator2 = localArrayList.iterator();
label86: if (localIterator2.hasNext())
break label215;
}
}
while (true)
{
if (i != 0)
MySpeechRecogonizer.this.position = 0;
if ((j == 0) || (MySpeechRecogonizer.this.matchListener == null))
break label404;
MySpeechRecogonizer.this.matchListener.onSpeechMatch();
return;
label136:String str2 = (String)localIterator1.next();
Log.e(MySpeechRecogonizer.this.TAG, str2 + MySpeechRecogonizer.this.target);
if (!str2.trim().replace(" ", "").contains(MySpeechRecogonizer.this.target))
break;
j = 1;
break label75;
label215:
String str3 = (String)localIterator2.next();
我在label215
,label136
以及label75
后出现语法错误,需要分号预期或赋值运算符才能完成语句。那是为什么?
答案 0 :(得分:1)
标签仅在2种情况下有效:
label:
for(int i = 0; i < listA.size(); i++)
{
// doSomething
while(someCondition)
{
// do another thing
if(conditionA) continue label;
if(conditionB) break label;
// rest of code
}
// another code
}
label:
{
// do something
if(someCondition) break label;
// rest of code
}