Avoid using java iterator

While iterating, it would keep check the original collection/(the iterator, if its as a snapshot the collection). It would throw ConcurrentModificationException, if detected that the collection is modified.

Advertisements

Author: lwpro2

Java J2EE professional

2 thoughts on “Avoid using java iterator”

  1. it is to use Iterator’s remove method rather than collection’s own remove method to avoid ConcurrentModificationException

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s