ArrayList遍历时add()或者remove()为什么会报ConcurrentModificationException异常
首先分析增强for循环或者迭代器遍历时候的next方法
public E next() {
checkForComodification();
int i = cursor;
if (i >= size)
throw new NoSuchElementException();
Object[] elementData = ArrayList.this.elementDat
原创
2021-04-20 15:24:33 ·
315 阅读 ·
0 评论