remove elements from CopyOnWriteArrayList

前端 未结 9 2001
醉酒成梦
醉酒成梦 2020-12-29 09:27

I am getting an exception when I try to remove elements from CopyOnWriteArrayList using an iterator. I have noticed that it is documented

Element-c

9条回答
  •  臣服心动
    2020-12-29 10:03

    Below works fine with CopyOnWriteArrayList

    for(String key : list) {
        if () {
            list.remove(key);
        }
    }
    

提交回复
热议问题