java.util.ConcurrentModificationException详解
【引言】经常在迭代集合元素时,会想对集合做修改(add/remove)操作,类似下面这段代码:for (Iterator it = list.iterator(); it.hasNext(); ) { Integer val = it.next(); if (val == 5) { list.remove(val); }}运行这段代码,会抛出异