我收到就行了以下错误在那里说:ht.keySet()
:类型不匹配:不能从元素类型对象转换为int
类型不匹配:不能从元素类型对象转换为int
ht
是LinkedHashMap
。
for (int key : ht.keySet())
{
if(ht.get(key).size() == 0)
{
System.out.println("There is no errors in " + key) ;
}
else
{
System.out.println("ERROR: there are unexpected errors in " + key);
}
}
我不是确定这是Java中有效的_for_语句。 [Java] for“loop”(http://download.oracle.com/javase/tutorial/java/nutsandbolts/for.html) – m0skit0
@ m0ski0:从来没有听说过'for-each'? http://download.oracle.com/javase/1.5.0/docs/guide/language/foreach.html –