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
Can you instantiate the math class in Java?
What are untrusted applets?
What are filterstreams?
Why array is used in java?
Why Java is not pure Object Oriented language?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
What are the parts of a method?
When a byte datatype is used?
Why for each loop is used?
Why java is called not pure object oriented language?
Can interface be private in java?
What is natural ordering in java?
What is the difference between jvm and jre? What is an interface?
can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread
What is java regex?