Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Can some one tell me the basics of collections

  Asked By: Jamil    Date: Oct 24    Category: Java    Views: 577

I am a newbie to this world of Java. I am trying to get an
understanding on different collection objects like the HashTable,
HashMap, LinkedList. How can I decide which artifact to use to hold a
collection of object. Some reference site url is also fine.



2 Answers Found

Answer #1    Answered By: Helga Miller     Answered On: Oct 24

Well you should definitely use the new collections  (i.e. HashMap,
ArrayList, etc.) in favor of the old ones (i.e. Hashtable, Vector). The
type of collection  you use depends on whether you want a list of things
(then you'd use ArrayList, LinkedList or something similar) or a map
which maps keys to values (in which case you'd probably use HashMap).
HashMap stores keys in any order but there are also variations which
provide sorting by natural order. Additionally there are utility
methods in Collections which help with this as well.

Try java.sun.com/docs/books/tutorial/collections/ for more

Answer #2    Answered By: Willard Washington     Answered On: Oct 24
Didn't find what you were looking for? Find more on Can some one tell me the basics of collections Or get search suggestion and latest updates.