O'Reilly logo
  • Ravindra Jain thinks this is interesting:

Iterator<E> iterator()


Java 8 introduces Spliterator for parallel processing of a collection. What is the difference between fail-fast and fail-safe iterators? Ans : Iterators for different collections are either fail-fast or fail-safe, depending on how they react to concurrent modifications. The concurrent modification is not only a modification of collection from another thread but also modification from the same thread but using another iterator or modifying the collection directly.