Vector was part of 1.0 -- the original implementation had two drawbacks:
1. Naming: vectors are really just lists which can be accessed as arrays, so it should have been called ArrayList
(which is the Java 1.2 Collections replacement for Vector
).
2. Concurrency: All of the get()
, set()
methods are synchronized
, so you can't have fine grained control over synchronization.
There is not much difference between ArrayList
and Vector
, but you should use ArrayList
.
From the API doc.
As of the Java 2 platform v1.2, this class was retrofitted to implement the List interface, making it a member of the Java Collections Framework. Unlike the new collection implementations, Vector is synchronized.