java Iterator与for 循环结合使用的问题
芒果炖牛肉 2017-06-29 03:50:06 for(Iterator<VendorPerforScoresIndexEntity> iterator=indexList.iterator();iterator.hasNext()&&100==iterator.next().getScore());){
iterator.remove();
}
for (Iterator<VendorPerforScoresIndexEntity> iterator = indexList.iterator(); iterator.hasNext(); ) {
if (100==iterator.next().getScore()) {
iterator.remove();
}
}
这两块代码执行结果一致吗?为什么