ConcurrentModificationException

Getting this error ?

java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:449)
at java.util.AbstractList$Itr.next(AbstractList.java:420)
This exception might be happened because of:

1. Doing an iteration over a collection that is being modified during the loop. For example:
for (Object object: list) {
list.remove(object);
}
2. Modifying the list at the same time (because List isn't thread safe). It can only happen either when the list object was declared static or singleton, or it's owned by a static or singleton object.

1 comments: (+add yours?)

Galia Co Hagan said...

Thanks for the post, I am techno savvy. I believe you hit the nail right on the head. I am highly impressed with your blog. It is very nicely explained. Your article adds best knowledge to our Java Online Training from India. or learn thru Java Online Training from India Students.

or learn thru JavaScript Online Training from India. Appreciating the persistence you put into your blog and detailed information you provide. Kindly keep blogging.