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 format specifier?
How do you create a first line indent?
Why do we need wrapper classes?
What does a void function return?
What is an abstract class and what is it’s purpose?
How hashmap works in java?
What is the difference between a break statement and a continue statement?
What is thread life cycle in java?
why are wait(), notify() and notifyall() methods defined in the object class? : Java thread
Which java ide is used the most?
Explain naming conventions for packages?
Is static variable stored in heap?
What is public/private protected in java?
What is a private class in java?
What value is a variable of the string type automatically initialized?