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
How define set in java?
Difference between nested and inner classes ?
What are the object and class classes used for?
What does escaping a character mean?
What is the purpose of a default constructor?
What is bubble sorting in java?
Why do we use threads in java?
What are the types of collections in java?
What is supplier in java?
What is a flag variable?
What is a double?
What is string in java is it a data type?
What is the difference between a scrollbar and a scrollpane?
What is a numeric string?
Explain what is Marker interface?