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


Please Help Members By Posting Answers For Below Questions

Variables used in a switch statement can be used with which datatypes?

758


How do you use wildcards?

779


What is lambda expression in java?

754


What is difference between module and function?

799


Are arrays static in java?

825


What are the procedures?

851


What is set in java?

796


What is difference between fail-fast and fail-safe?

914


What is double in java?

754


Give an example of use of pointers in java class.

785


What is difference between java and java ee?

788


What is the syntax and characteristics of a lambda expression?

830


Can classes declared using the abstract keyword cab be instantiated?

849


How do you square a number?

910


What are the benefits of immutable objects?

775