I\'ve run into this while writing a Traveling Salesman program. For an inner loop, I tried a
for(Point x:ArrayList) { // modify the iterator }
You cannot modify a List while you are iterating over it which you are doing in the first example. In the second you simply have a regular for loop.
List
for