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

Which package is always imported by default?

0 Answers  


How listener identify that the event came from a particular object?

0 Answers  


Does java support multi dimensional arrays ?

6 Answers  


What is a class object?

0 Answers  


What is a databasemetadata?

0 Answers  


Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.

0 Answers   V2 Solutions,


why applet doesn't have main? isn't possible a program with out main?

9 Answers   TCS,


How will you compute size of a structure?

0 Answers   Amdocs,


Why there are some null interface in java? What does it mean?

0 Answers  


Which collection is best for sorting in java?

0 Answers  


If I only change the return type, does the method become overloaded?

0 Answers  


How transient variable is different from volatile variable?

0 Answers  


Categories