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 define set in java?

770


Difference between nested and inner classes ?

810


What are the object and class classes used for?

796


What does escaping a character mean?

728


What is the purpose of a default constructor?

833


What is bubble sorting in java?

811


Why do we use threads in java?

810


What are the types of collections in java?

792


What is supplier in java?

775


What is a flag variable?

744


What is a double?

825


What is string in java is it a data type?

743


What is the difference between a scrollbar and a scrollpane?

810


What is a numeric string?

773


Explain what is Marker interface?

835