Java Map在遍历过程中删除元素
Java中的Map如果在遍历过程中要删除元素,除非通过迭代器自己的remove()方法,否则就会导致抛出ConcurrentModificationException异常。JDK文档中是这么描述的:The iterators returned by all of this class’s “collection view methods” are fail-fast: if the map ...