Fail Safe vs Fail Fast Iterator
* When we are iterating the collections, and at the same time if we are modify the collection, then it will throw uninterepted exception. This is Called Failed Fast Iterator.
* But it will not throw the error for above use case, that is called Fail Safe Iterator.
Eg for Fail Safe Iterator,
CopyOnWriteArrayList, ConcurrentHashMap - These are synchronized. So it will not throw error
Comments
Post a Comment