Results 1 to 8 of 8
Like Tree1Likes
  • 1 Post By sunde887

Thread: how do we know which collection class to use when?

  1. #1
    Adithi is offline Member
    Join Date
    Aug 2011
    Posts
    14
    Rep Power
    0

    Default how do we know which collection class to use when?

    Hi ,

    We have many collection classes,ArrayList, HashSet,Vector etc.

    How do we analyse and decide which one to use when.

    Thanks.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default Re: how do we know which collection class to use when?

    Experience.

    Are you going to dump all your homework questions on the forum? Have you done any research to answer these questions yourself?

  3. #3
    Adithi is offline Member
    Join Date
    Aug 2011
    Posts
    14
    Rep Power
    0

    Default Re: how do we know which collection class to use when?

    Excuse me... These are not my home work questions..they are my own questions... and as I donot have experience, and want to know/learn something, I keep posting here(New To Java Forum).. that the experienced guys help us learn..

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: how do we know which collection class to use when?

    What Junky asking here is that your question is not more descriptive. In other words your question give me an impression that you have not read/search anything related with your question. If you have did that you may ask a question something like "Why we are using a ArrayList instead LinkedList in case of ...?". Did yu get our point?

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: how do we know which collection class to use when?

    Read about three main collections on Java DOC and other stuff, which as Set, List and Map. Then try to summarize them. Adding them into a table is really nice. For example, when comes to the collections in a List you can store duplicates items (relevant to key) while in Sets or Maps you cannot.

  6. #6
    vinci123 is offline Member
    Join Date
    Aug 2011
    Location
    INDIA
    Posts
    64
    Rep Power
    0

    Default Re: how do we know which collection class to use when?

    what about next??i mean how to implement them in real world examples?

  7. #7
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default Re: how do we know which collection class to use when?

    Understanding how they work will help you understand the situations in which they are used.
    Eranga likes this.

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: how do we know which collection class to use when?

    Quote Originally Posted by sunde887 View Post
    Understanding how they work will help you understand the situations in which they are used.
    I agreed with Sunde. Without having a better understanding, you never understand the practical aspect of such.

Similar Threads

  1. Collections, Collection From one class to another
    By D.Calladine in forum New To Java
    Replies: 2
    Last Post: 11-23-2010, 02:10 PM
  2. Collections, Collection From one class to another
    By D.Calladine in forum New To Java
    Replies: 2
    Last Post: 11-16-2010, 03:39 PM
  3. collection class in java
    By katturv in forum New To Java
    Replies: 5
    Last Post: 10-24-2010, 07:09 PM
  4. Java Collection class & methods
    By box2box in forum New To Java
    Replies: 2
    Last Post: 05-26-2010, 01:51 AM
  5. know the class coming under the collection api in java
    By javastuden in forum New To Java
    Replies: 1
    Last Post: 11-24-2009, 07:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •