Wednesday, September 17, 2014

Differences between ArrayList and Vector in Java

11:53 AM

One of the most frequently asked question in java is what are the main differences between Vector and ArrayList ? Both Vector and ArrayList implements List interface, there are some differences in both classes.

Below are the few main differences between both the class.

Differences between ArrayList and Vector

S.No.

ArrayList

Vector

1.

All methods of ArrayList are
non-synchronized.

Most of the methods of Vector class are synchronized.

2.

They are not thread safe.

They are thread safe.

3.

Multiple threads can operate at a same
time.

Only one thread can operate at a time.

4.

Relatively performance is high as multiple thread are allowed to operate at a time.