Since jdk 1.2 Vector has been retrofitted to implement the List interface and therefore become a member of the Collections framework. This has led to the practice of defining your collections by their Interface. For example
However if your collection doesn't need synchronization you could always change the above code to:
without your program being impacted too much.
Read
The Collection Trail by Joshua Bloch
Originally by Joshua Bloch:
If you need synchronization, a Vector will be slightly faster than an ArrayList synchronized with Collections.synchronizedList, but Vector has loads of legacy operations, so be extra careful to always manipulate the Vector with the List interface, or you'll be stuck with it for life.
and remember that the Collection framework allows for custom implementations with the aid of the abstract implementations already provided by the
Java platform.
[ November 08, 2004: Message edited by: Nigel Browne ]