Iterator in the HashMap is fail-safe means what?

Answer Posted / amol

The iterators for the concrete collection implementations
are fail-fast.
That means that if you are using an Iterator to traverse a
collection while underlying collection is being modified by
another thread, then the Iterator fails immediately by
throwing a ConcurrentModificationException (another
RuntimeException). That means the next time an Iterator
method is called, and the underlying collection has been
modified, the ConcurrentModificationException exception gets
thrown.

Is This Answer Correct ?    59 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is variable length arguments in java?

522


What are the types of methods in java?

582


Does java support Operator Overloading?

611


What is the disadvantage of java?

508


Can you override a final method?

584






What is a numeric literal?

532


What is comparator in java?

559


Discuss different types of errors that generally occur while programming.

583


Define nashorn in java8.

570


What is the difference between sop and work instruction?

488


Define iterator and methods in iterator?

547


What is a java applet? What is an interface?

635


What does this () mean in java?

549


When is the garbage collection used in Java?

658


Tell me the latest versions in java related areas?

587