Sunday, 15 January 2012

JAVA : Difference between Vector and ArrayList?

Vector :
  1.               It's synchronized.
  2.               It's slower than ArrayList.
  3.               It's generally used in multithreading programs.

ArrayList :
  1.               It's unsynchronized.
  2.               It's faster than Vector.
  3.               It's generally used in single-thread programs.





7 Responses to “JAVA : Difference between Vector and ArrayList?”

chmod examples unix said...
27 March 2012 21:08

Good differences, nicely put in point format. another one is that vector was not member of collection framework prior to JDK 1.4 and later retrofitted into Collection API. see here for more differences between Vector and ArrayList


Anonymous said...
14 April 2012 16:14

Nicely written


anij said...
14 April 2012 20:21

@Anonymous
Thanks a lot my friend!!
thanks for commenting!!


Anonymous said...
26 April 2012 11:37

ArrayList does allow null. Stop posting wrong information.


Anonymous said...
7 May 2012 22:14

Vector is a part of collection frame work please go the 1.3 documentation of Oracle.


kuldeep said...
9 September 2012 14:57

we can specify the increment size with the vector and with arraylist we can't.


Hashtable vs HashMap said...
26 September 2012 21:41

One more difference between ArrayList vs Vector is that later is a legacy class and initially not part of Collection API


Post a Comment

blog links Web Directory Academics Blogs