Java Arraylist VS Vector in context of threading
Java ArrayList VS Vector ArrayList properties ArrayList is implemented using array as internal data structure. It can be dynamically resized ArrayList increases half of its size when its size is increased ArrayList faster than Vector Vector properties Vector is synchronized (so thread safe) Vector is implemented using array as internal data structure. It can be dynamically resized. Vector doubles size of array when its size is increased. Major difference between ArrayList and Vector is that ArrayList is not synchronized and Vector is synchronized. That is why vector can be used in multi threaded and concurrent environment more appropriately and efficiently. We can use ArrayList in multi threading environment if multiple threads are only reading values from ArrayList. We can also make read only ArrayList as well. ArrayList faster than Vector as it is Asynchronous. so if we want to read only ArrayList is more efficeint and faster than Vector. By Ha...