Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which collection prefered?

 
Alex Leung
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have done some research on which collection looks possible for handling the implemnetation of this assignment, while I do think Vector is capable of doing the job, Hashmap seems to be better because it uses keys, but I could use the Vector index as key implemnetation as well.
Collection.synchronizedMap/Set can be use on Hashmap and set. Other collections like Hashtable and Hashset also provide simliar functionalities too.
Personally I think I perfered Hashmap, but any advices or suggestion?
Thank you
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First it is preferred to use ArrayList and HashMap over Vector and HashTable. The first two are considered the newer Collection classes. As far as all the others, it really depends on what you want to store and how. When you know that the choice becomes easy, because there is one and only One Collection that handles exactly that. Sort of.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic