• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

which collection prefered?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Let me tell you a story about a man named Jed. He made this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic