上代碼先
list中數據是不能在原有集合修改,需要循環刪除list中多個元素的,應該使用迭代器iterator方式,不然會報錯
Iterator it = list.iterator();
while (it.hasNext()){
it.next();
? ? it.remove();
}
上代碼先
list中數據是不能在原有集合修改,需要循環刪除list中多個元素的,應該使用迭代器iterator方式,不然會報錯
Iterator it = list.iterator();
while (it.hasNext()){
it.next();
? ? it.remove();
}