Why ArrayList class is not a synchronized class and why it
is not a thread safe class? explain

Answer Posted / atre sachin

If multiple threads access an ArrayList instance concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more elements, or explicitly resizes the backing array; merely setting the value of an element is not a structural modification.)

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the “static” keyword mean?

817


Difference between association, composition and aggregation?

755


What is one third plus one third as a fraction?

684


Can a variable be local and static at the same time?

763


What is the integer of 16?

752


What are the different collection views provided by maps?

762


Is null a string in java?

761


What is string value?

841


What are the advantages of java over C++?

924


What is implicit object in java?

807


Can we declare a class as abstract without having any abstract method?

768


What is mvc in java?

786


What is hotjava?

739


What is yield () in java?

665


What is the main difference between java platform and other platforms?

708