如何获得此代码块的 ConcurrentModificationException ?
synchronized (list) {
for (Iterator<?> it = list.iterator(); it.hasNext(); ) {
Object object = it.next();
// do something to object without touching list
}
}
编辑:对不起,这不够具体://对对象做一些事情不会触及列表