Iterator in the HashMap is fail-safe means what?

Answer Posted / amol

The iterators for the concrete collection implementations
are fail-fast.
That means that if you are using an Iterator to traverse a
collection while underlying collection is being modified by
another thread, then the Iterator fails immediately by
throwing a ConcurrentModificationException (another
RuntimeException). That means the next time an Iterator
method is called, and the underlying collection has been
modified, the ConcurrentModificationException exception gets
thrown.

Is This Answer Correct ?    59 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many bits is a boolean?

834


What is main method?

794


What is a nested structure?

756


Can we nested try statements in java?

872


What are static blocks and static initalizers in java ?

803


What is boolean example?

753


How garbage collection is done in java?

801


What is java in detail?

842


How many java versions are there?

771


Difference between a class and an object?

786


What is java and its types?

794


Can a abstract class be declared final?

805


How to pass arraylist to stored procedure in java?

801


Differentiate jar and war files?

803


What about features of local inner class?

849