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
Variables used in a switch statement can be used with which datatypes?
How do you use wildcards?
What is lambda expression in java?
What is difference between module and function?
Are arrays static in java?
What are the procedures?
What is set in java?
What is difference between fail-fast and fail-safe?
What is double in java?
Give an example of use of pointers in java class.
What is difference between java and java ee?
What is the syntax and characteristics of a lambda expression?
Can classes declared using the abstract keyword cab be instantiated?
How do you square a number?
What are the benefits of immutable objects?