に問題がありConcurrentModificationException
ます。
私が定義したクラスがArrayList
あります。Complex
2 つの es を追加し、 for eachループComplex
を実行しようとしましたが、 . ただし、その行を削除すると、エラーは発生しません。後で必要になるポイントを計算するために、これらの初期ポイントが必要です。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();
}