1.

What Is Copyonwritearraylist In Java?

Answer»

CopyOnWriteArrayList is also an implementation of the List interface but it is a thread safe variant. This thread safety is achieved by MAKING a fresh copy of the underlying array with EVERY mutative operations (ADD, set, and so on).

USING CopyOnWriteArrayList PROVIDES better performance in scenarios where there are more iterations of the list than mutations.

CopyOnWriteArrayList is also an implementation of the List interface but it is a thread safe variant. This thread safety is achieved by making a fresh copy of the underlying array with every mutative operations (add, set, and so on).

Using CopyOnWriteArrayList provides better performance in scenarios where there are more iterations of the list than mutations.



Discussion

No Comment Found