摘要: Iterator的定义代码 通过代码我们发现 Itr 是 ArrayList 中定义的一个私有内部类,在 next、remove方法中都会调用 checkForComodification 方法,该方法的作用是判断 modCount != expectedModCount是否相等,如果不相等则抛出C 阅读全文
posted @ 2019-08-05 19:57 暮雨晨光 阅读(4946) 评论(0) 推荐(0) 编辑
摘要: 方式一:使用Iterator的remove()方法 方式二:使用List的remove()方法,注意list.size()的位置 方式三:使用CopyOnWriteArrayList 阅读全文
posted @ 2019-08-05 19:33 暮雨晨光 阅读(670) 评论(0) 推荐(0) 编辑