Vector & ArrayList both classes are implemented using dynamically resizable arrays, providing fast random access and fast traversal. ArrayList and Vector class both implement the List interface. Both the classes are member of Java collection framework, therefore from an API perspective, these two classes are very similar. However, there are still some major differences between the two. Below are some key differences
Vector is a legacy class which has been retrofitted to implement the List interface since Java 2 platform v1.2
Vector is synchronized whereas ArrayList is not. Even though Vector class is synchronized, still when you want programs to run in multithreading environment using ArrayList with Collections.synchronizedList() is recommended over Vector.
ArrayList has no default size while vector has a default size of 10.
The Enumerations returned by Vector's elements method are not fail-fast. Whereas ArraayList does not have any method returning Enumerations.
Liked By
Write Answer
11.Difference between Vector and ArrayList? What is the Vector class?
Join MindStick Community
You have need login or register for voting of answers or question.
Amit Singh
16-Apr-2011