ConcurrentModificationException
来源:互联网 发布:网络心理咨询师招聘 编辑:程序博客网 时间:2024/04/29 20:24
http://stackoverflow.com/questions/1496180/concurrent-modification-exception
Between creating the iterator and starting to use the iterator, you added arguments to the list that is to be iterated. This is a concurrent modification.
ListIterator<String> it = s.listIterator(); for (String a : args) s.add(a); // concurrent modification here if (it.hasNext()) String item = it.next(); // exception thrown here
Create the iterator AFTER you've finished adding elements to the list:
for (String a : args) s.add(a); ListIterator<String> it = s.listIterator(); if (it.hasNext()) String item = it.next();
0 0
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException
- ConcurrentModificationException 异常
- 153. Find Minimum in Rotated Sorted Array
- APP
- 1067: [SCOI2007]降雨量 我不知道这是个什么鬼
- Android群英传——第四章ListView常用优化
- 162. Find Peak Element
- ConcurrentModificationException
- 209. Minimum Size Subarray Sum
- 152. Maximum Product Subarray
- Android下创建隐藏文件
- 认知【STL】里的set和multise
- 使用DOS命令创建一个基于Maven的Web项目
- 点击listview的item,带动画效果的展开详情(二)
- 欢迎使用CSDN-markdown编辑器
- Python内建方法