在CopyOnWriteArrayLIst

时间:2019-03-22 02:48:11

标签: java collections

我是Collections框架的初学者,并在CopyOnWriteArrayList中遇到了这个概念:

the remove() operation on the returned Iterator is not permitted – resulting with UnsupportedOperationException. However the remove() method of the CopyOnWriteArrayList itself is permitted.

我知道对于每个突变都会创建一个基础列表的副本,但是我不确定为什么不允许上述情况。任何人都可以解释为什么会这样吗?

0 个答案:

没有答案