• Post Reply Bookmark Topic Watch Topic
  • New Topic

which collection prefered?  RSS feed

 
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: 17309
11
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!