1.

Which class provides thread safe implementation of List?(a) ArrayList(b) CopyOnWriteArrayList(c) HashList(d) ListThis question was posed to me in an international level competition.I'm obligated to ask this question of Data Structures-List topic in section java.util – The Collections Framework of Java

Answer»

Correct CHOICE is (b) COPYONWRITEARRAYLIST

The explanation: CopyOnWriteArrayList is a concurrent collection class. Its very efficient if ARRAYLIST is mostly used for reading purpose because it allows multiple threads to read data without LOCKING, which was not POSSIBLE with synchronized ArrayList.



Discussion

No Comment Found

Related InterviewSolutions