关于使用concurrenthashmap是否会抛出ConcurrentModificationException的问题,麻烦老师抽空解答
来源:5-7 同步容器-2
![](http://img1.sycdn.imooc.com/user/5b55f63c00018a7209600960-100-100.jpg)
年轻人要早点睡
2019-06-10
我遇到这样个问题,使用hashmap存一些复制粘贴信息,粘贴完成后删除信息,就用的是迭代器删除,项目上抛出ConcurrentModificationException异常,百度后有几种解决办法,其中一种是使用concurrenthashmap,那看完这个视频是不是证明使用concurrenthash也并不能解决问题呢?项目上改完后到现在没有出现过问题,谢谢老师解答。
写回答
1回答
-
你好,出现ConcurrentModificationException本质上是出现并发问题了,而concurrenthashmap就是解决这类并发问题的,因此没必要担心concurrenthashmap出现ConcurrentModificationException问题
022019-06-11
相似问题