我有一个问题ConcurrentModificationException。
我有一个我定义ArrayList的Complex类。我添加了两个Complexes,并尝试为每个循环做一个,但我得到了ConcurrentModificationException. 但是,当我删除该行时,我没有收到任何错误。我需要那些初始点(1,0)来(-1,0)计算我以后需要的点。
        for (Iterator<Complex> num = dots.iterator(); num.hasNext();) {
            // ConcurrentModificationException
            Complex aComplex = num.next();
            // clone it and clear
            temp.add(new Complex(aComplex));
            dots.clear();
        }