final void checkForComodification() {
if (modCount != expectedModCount)
throw new ConcurrentModificationException();
}
}
}
这是AbstractList抽象类里的一个源代码一部分,我想问一下Itr他这个内部类调用了remove方法,删除元素,但是AbstractList抽象类里的那个remove方法只是抛出一个异常,那它是怎么删除的呢??作者: 刘士 时间: 2012-4-11 12:37
查API得知
public abstract class AbstractList<E>extends AbstractCollection<E>implements List<E>此类提供 List 接口的骨干实现,以最大限度地减少实现“随机访问”数据存储(如数组)支持的该接口所需的工作。对于连续的访问数据(如链表),应优先使用 AbstractSequentialList,而不是此类。