Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Differences between vector and arraylist

 
Anwar Hussain
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I have got two difference

Vector is a legacy class
where as ArrayList is not a legacy class.

Vector is synchronized but ArrayList is not.

Any more differences please let me know.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is pretty much the only difference between Vector and ArrayList. Same with StringBuilder and StringBuffer.

Both synchronized versions are legacy and should not be used.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic