Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

What is the difference between Fail-fast and Fail-safe iterator in Java?

Pragya Keshap answered on February 4, 2023 Popularity 3/10 Helpfulness 2/10

Contents


More Related Answers

  • What is the difference between Iterator and Enumeration in Java?

  • What is the difference between Fail-fast and Fail-safe iterator in Java?

    0

    Differences between Fail-fast and Fail-safe iterators are as

    follows:

    Fail-fast iterator throws ConcurrentModificationException. But

    Fail-safe iterator does not throw this exception.

    Fail-fast iterator does not clone the original collection. Fail-safe

    iterator creates a copy of the original collection of objects.

    A Fail-fast iterator tries to immediately throw Exception when it

    encounters failure. A Fail-safe Iterator works on a copy of

    collection instead of original collection.

    https://www.javatpoint.com/fail-fast-and-fail-safe-iterator-in-java#:~:text=The%20Java%20Collection%20supports%20two,in%20case%20of%20a%20failure.

    Popularity 3/10 Helpfulness 2/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 04 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.