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
Is java based on c?
Why strings in java are called as immutable?
Why java is considered dynamic?
What is jvm? How its run?
What restrictions are placed on method overloading?
What is java virtual machine and how it is considered in context of java’s platform independent feature?
What is java argument list?
Which category the java thread do fall in?
Where is java located?
What is internal variable?
What are bind parameters?
why are there separate wait and sleep methods? : Java thread
Can a set contain duplicates?
What is the use of put method?
How many types of constructors are used in java?