• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Differences between vector and arraylist

 
Anwar Hussain
Ranch Hand
Posts: 35
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic