Iterator in the HashMap is fail-safe means what?
Answer Posted / namy
Fail-safe is relevant from the context of iterators. If an iterator has been created on a collection object and some other thread tries to modify the collection object "structurally”, a concurrent modification exception will be thrown. It is possible for other threads though to invoke "set" method since it doesn’t modify the collection "structurally”. However, if prior to calling "set", the collection has been modified structurally, "IllegalArgumentException" will be thrown.
| Is This Answer Correct ? | 19 Yes | 2 No |
Post New Answer View All Answers
What are singleton services?
What are the advantages of exception handling in java?
What is ‘has a’’ relationship in java?
What is e in java?
Why java is not 100% object-oriented?
What are the parts of a method?
Is break statement can be used as labels in java?
What are basic keywords?
Explain throw keyword in java?
What's the base class of all exception classes?
What is maximum size of arraylist in java?
What is incompatible types in java?
How does split work in java?
What’s a deadlock?
What is difference between path and classpath variables?