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 purpose of using break in each case of switch statement?
What are the steps involved to write rmi based programs?
What is return used for in java?
What does it mean that a method or field is “static”?
What is Java Reflection API? Why it’s so important to have?
What is final method?
What is nextline method in java?
Why java uses the concept of the string literal?
What are the advantages of exception handling?
What is byte value?
Can we convert stringbuffer to string?
What are constructors in java?
How to handle a web browser resize operation?
What is concurrent hashmap and its features?
What are different type of exceptions in java?