首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

多线程 Java.util.ConcurrentModificationException错误

2012-09-22 
多线程 Java.util.ConcurrentModificationException异常IteratorEntryString,Boolean iter set.iter

多线程 Java.util.ConcurrentModificationException异常

Iterator<Entry<String,Boolean>> iter = set.iterator();while(iter.hasNext()){Entry<String,Boolean> entry = iter.next();String key = entry.getKey();}


这里的next会抛出Java.util.ConcurrentModificationException。
在网上很多人都说,用了romove办法,这里,我没调用过remove。原因没明。

热点排行