Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By doWhile

Thread: TreeMap or Vector

  1. #1
    Edinson is offline Member
    Join Date
    Sep 2012
    Rep Power

    Default TreeMap or Vector

    Hi I am new here,

    I have a problem,
    I am going to retrieve a certain object information
    I am trying to make it as efficient
    So by using TreeMap.get(), is it faster than Vector.get()

    Thanks in advance.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Rep Power

    Default Re: TreeMap or Vector

    A Map and List (the interface Vector implements) do different things, and you didn't explain enough to recommend one vs. the other. If you want key/value pairs, use a Map. If you want an ordered List, then use a List. If you want some variety of either (for instance, ordered key's in a key/value Map - eg TreeMap), then choose the appropriate implementation
    DarrylBurke likes this.

Similar Threads

  1. TreeMap vs Map
    By alpdog14 in forum New To Java
    Replies: 5
    Last Post: 03-27-2011, 06:07 PM
  2. [JAVA] TreeMap
    By watle in forum Advanced Java
    Replies: 3
    Last Post: 03-16-2011, 05:39 PM
  3. Treemap question
    By dave120 in forum New To Java
    Replies: 0
    Last Post: 10-13-2009, 02:31 AM
  4. Treemap's
    By Russo in forum New To Java
    Replies: 6
    Last Post: 10-11-2009, 01:13 AM
  5. How to use treemap
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-12-2008, 08:47 PM

Posting Permissions

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