Fail fast & Fail safe Iterators in Java

Iterators are basically used to traverse over a set of objects one by one. Java supports two types of Iterators  Fail Fast Iterator Fail Safe Iterator Fail Fast Iterator Fail fast iterator do not allow any modifications to a collection while iterating/traversing the collection.By modification I mean any updating, addition of elements in the collection.If […]