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 extraneous variables examples?
What language is pass by reference?
What is the purpose of garbage collection in java, and when is it used?
How many types of design patterns are there?
What is boolean query?
How to perform bubble sort in java?
What does flag mean in java?
Can a class have 2 constructors?
Does java map allow duplicates?
Is string pool garbage collected?
Can a function return a function?
What is the difference between access specifiers and access modifiers in java?
What modifiers may be used with a top-level class?
What is the abstract class?
Can you inherit a constructor java?