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



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

Answer / 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

More Core Java Interview Questions

I want to store more than 10 objects in a remote server? Which methodology will follow?

0 Answers  


What is ternary operator? Give an example.

0 Answers  


What is toarray method in java?

0 Answers  


What are the two environment variables that must be set in order to run any java programs?

0 Answers  


Should a main method be compulsorily declared in all java classes?

0 Answers  






Where are global variables stored?

0 Answers  


What is Applet Flickering ?

1 Answers   Infosys, Persistent,


What is the difference between error and an exception?

0 Answers  


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

0 Answers   Global Logic,


How many types of thread in java? give the name

13 Answers   Cisco, NIIT,


What is the purpose of garbage collection in java, and when is it used?

0 Answers  


Explain how can you debug the Java code?

0 Answers   BirlaSoft,


Categories