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 do you mean by an object in java?
How many times finalize method will be invoked? Who invokes finalize() method in java?
Explain about public and private access specifiers?
How do we access static members in java?
What is java beans?
How many bits is a 64 bit byte?
Differentiate between nested and inner class in java.
What is a key in java?
What are the restriction imposed on a static method or a static block of code?
What is flag in java?
What is unicode in java?
What is a local block?
What is string builder?
What is unicode used for?
Can a function return a function?