• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Performance of ArrayList and Vector

 
Erik Hu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all
I've done some test, but can not see the difference of ArrayList and Vector, anyone who has some better suggestion?
 
dan moore
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
compared on performance (not behaviour)? what were your results?
 
kumud sharma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vectors are always the prefered data structure as internally it implements arrays.
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Copy of an answer I posted in a different forum)
The simple answer: ArrayList is faster
Why? Vector has been around longer and developed into a sort of be-all do-all class with synchronization and support for many different API. ArrayList is a straitforward implementation of a List with no whistles or bells.
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic