Every time I try to call ArrayList.remove() on an element while in a for each loop, Java throws a ConcurrentModificationException. I need to remove an element in a for loop because in there is where I look through the objects to find objects which meet the criteria for removal.
>>31,33 http://www.docjar.com/html/api/java/util/ArrayList.java.html
Since Java arrays are fixed-size, they would eventually need to have a new array created and the objects copied into the new array using System.arraycopy. Internally, a Java ArrayList isn't much different than a C++ std::vector or a C array expanded using realloc (except for the bloated unneeded error handling).