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
What is the size of a string in java?
What is lambda in java?
Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?
Why does java not allow multiple public classes in a java file ?
What is bean? Where it can be used?
What is the use of callablestatement?
Which class should you use to obtain design information about an object in java programming?
Difference between method overloading and method overriding in java ?
What does isempty () do in java?
How to convert string to byte array and vice versa?
What is the this keyword?
What does sizeof return?
Explain what access modifiers can be used for methods?
Explain the use of javap tool.
What are the characteristics of java?