Friday 15 March 2013

What is the difference between Vector, Array and Arraylist?

What is the difference between Vector, Array and Arraylist? 
1. ArrayList is not synchronized whereas the Vector is synchronized.

2. Arraylist is faster whereas Vector is slower in processing.

3. Elements in the arraylist can be traversed using iterator interface whereas in the case of Vector we can traverse using the Enumeration interface
1. Vector and Arraylist are grownable or shinkable where array is not. 
2. Vector and Arraylist are implemented from List interface where as array is a primitive data type
 
3. Vector is Synchronized where as arraylist is not
 
4. For best
 performance better to use arraylist than vector. 



Blog Author: Vijay Kumar

Go to: Coding Problem Solutions

No comments: