A thread-safe variant of java.util.ArrayList in which all mutative operations add, set, and so on are implemented by making a fresh copy of the underlying array.
It is more efficient than alternatives i.e. Vector and synchronizedList (java.util. Collections.synchronizedList()) when traversal operations large number mutations.
It is useful when we don't want to synchronize traversals, yet need to prevent the interference among concurrent threads.
The "snapshot" style iterator method uses a reference to the state of the array at the point that the iterator was created. This array never changes during the lifetime of the iterator, so interference is impossible and the iterator is guaranteed not to throw ConcurrentModificationException.
The iterator will not reflect additions, removals, or changes to the list since the iterator was created.
Element-changing operations on iterators themselves remove, set, and add are not supported. These methods throw UnsupportedOperationException.
All elements are permitted, including null.
Unlike ConcurrentHashMap, write operations that write or access multiple elements in the list (such as addAll(), retainAll()) will be atomic. During a write operation, the array must be locked completely against other writes.