Wissen Infotech Interview Question

How concurrent collection class are different from normal collection classes?

Interview Answer

Anonymous

Oct 11, 2020

Most of the classes present in Traditional/Normal Collections (i.e ArrayList, LinkedList, HashMap etc) are non-synchronized in nature and hence there is no thread-safety. But all the classes present in Concurrent Collections are synchronized in nature. Therefore in Concurrent classes, we don't have to take care about Thread-safety. In the Traditional Collections, if a thread is iterating a Collection object and if another thread try to add new element in that iterating object simultaneously then we will get RuntimeException or ConcurrentModificationException. Whereas in the concurrent collection classes we will not get any Runtime Exception.