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(); 
                }

 

 

你可能感兴趣的:(ArrayList迭代修改抛出ConcurrentModificationException)