ArrayList迭代修改抛出ConcurrentModificationException
生活随笔
收集整理的這篇文章主要介紹了
ArrayList迭代修改抛出ConcurrentModificationException
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
extends:http://www.cnblogs.com/dolphin0520/p/3933551.html
Iterator<Integer> iterator = list.iterator();while(iterator.hasNext()){Integer integer = iterator.next();if(integer==2)iterator.remove(); }
Iterator<Integer> iterator = list.iterator();while(iterator.hasNext()){Integer integer = iterator.next();if(integer==2)iterator.remove(); }
?
?轉載于:https://www.cnblogs.com/niray/p/5153551.html
總結
以上是生活随笔為你收集整理的ArrayList迭代修改抛出ConcurrentModificationException的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: cloudera manager 及CD
- 下一篇: js ajax上传图片到服务器