Difference between arraylist and vector is that, arraylist is synchronized where as vector is synchronized
False, ArrayList is
unsynchronized.
in arraylist when the data added increases array size will increase, but in vector when initial size should be specified, if we add more data to it, it will double the size giving more allocations.
This depends on how you construct the Vector. Check
java.util.Vector #capacityIncrement
If arraylist is not synchronized, how we can do it synchronized.
List<E> synchronizedList = Collections.synchronizedList(new ArrayList<E>());
If already list is there, what is the need of arraylist.
List is an interface, ArrayList is a basic implementation of this interface.
[ October 12, 2006: Message edited by: Bauke Scholtz ]