Results 1 to 3 of 3
  1. #1
    newbiejava is offline Senior Member
    Join Date
    Jan 2010
    Posts
    138
    Rep Power
    0

    Question Obsolete Collection, import java.util.Hashtable

    I got "Obsolete Collection" tool-tip message on below import command..

    import java.util.Hashtable;

    what is the substitution for it?

    please help

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,730
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by newbiejava View Post
    I got "Obsolete Collection" tool-tip message on below import command..

    import java.util.Hashtable;

    what is the substitution for it?
    In the Java API documentation 1.6 the Hashtable class isn't marked deprecated. If it were most likely the HashMap class could've been a nice replacement, but it isn't deprecated. You have to show us a bit more of your code because I suspect the warning is caused by something else ...

    kind regards,

    Jos

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,183
    Rep Power
    20

    Default

    HashMap.

    Hashtable and Vector are the old v1 collections.

    ETA: Jos, some IDEs are set so that they flag usage of Hashtable or Vector. I think FindBugs might have a rule for it, for example.

Similar Threads

  1. Why wont import jm.util.*; work??
    By cakepizza in forum New To Java
    Replies: 2
    Last Post: 01-02-2010, 12:19 AM
  2. Replies: 5
    Last Post: 05-06-2009, 09:51 PM
  3. import java.util ????
    By kris09 in forum New To Java
    Replies: 3
    Last Post: 08-11-2008, 01:39 AM
  4. java.util.DateFormat not found in import
    By christina in forum New To Java
    Replies: 2
    Last Post: 08-05-2007, 11:31 PM
  5. The import java.util.Scanner cannot be resolved
    By Heather in forum Advanced Java
    Replies: 1
    Last Post: 07-08-2007, 02:05 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
  •