How to modify a Collection while iterating using for-each loop without ConcurrentModificationException?

Viewed 59410

If I modify a Collection while iterating over it using for-each loop, it gives ConcurrentModificationException. Is there any workaround?

4 Answers
Related