ConcurrentModificationException可以在单线程环境中引发A。只要在不应该在上下文中修改对象的情况下使用它,就不必在另一个线程中进行修改。
例:
public class CME { public static void main(String...args) { HashSet<Integer> coll = new HashSet<Integer>(); coll.add(1); coll.add(2); coll.add(3); for(Integer i : coll) { coll.remove(i); // Throws ConcurrentModificationException } }}


