Java Modcount (ArrayList)

It allows the internals of the list to know if there has been a structural modification made that might cause the current operation to give incorrect results.

If you’ve ever gotten ConcurrentModificationException due to modifying a list (say, removing an item) while iterating it, its internal modCount was what tipped off the iterator.

The AbstractList docs give a good detailed description.

Leave a Comment