This class implements a hashtable, which maps keys to values. Any non-null object can be used as a key or as a value. To successfully store and retrieve objects from a hashtable, the objects used as keys must implement the hashCode method and the equals method. An instance of Hashtable has two parameters that affect its performance: initial capacity and load factor. The capacity is the number of buckets in the hash table, and the initial capacity is simply the capacity at the time the hash table is created. Note that the hash table is open: in the case a "hash collision", a single bucket stores multiple entries, which must be searched sequentially. The load factor is a measure of how full the hash table is allowed to get before its capacity is automatically increased. When the number of entries in the hashtable exceeds the product of the load factor and the current capacity, the capacity is increased by calling the rehash method.如果要更详细的,请下载javadoc文档自己看.

解决方案 »

  1.   

    Hashtable 常用的方法是put("",""),get(""),size("")
      

  2.   

    to 楼上:对,偶现在就想了解put()多一点....
    to xiaofenguser(风雨):不要都把别人当菜鸟嘛!!??虽然偶真的是Java菜鸟....但DOC还是知道的,要不是E文不过关....
      

  3.   

    Object put( Object key, Object value ) 
    [Parameters]
    key: the hashtable key. 
    value:the value. 
    [Returns]
    the previous value of the specified key in this hashtable, or null if it did not have one. 
    [Description]
    Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null. 
    The value can be retrieved by calling the get method with a key that is equal to the original key. 
    Exceptions
    NullPointerException if the key or value is null.
      

  4.   

    to LIFEForSoft(实习生....) :
       呵呵,没说你是菜鸟,我也才学不多长时间,也是菜鸟一只.
    只是告诉你去哪儿查,E文不行么,我告诉你我在高中英语就一直没及格过
    DOC上的E文不是很难看,如果你不学会看DOC你永远都只能停留在别人告诉你的阶段,还是下点功夫去看DOC吧
      

  5.   

    看doc很正确,偶开始用hashtable,hashmap的时候,都是看doc的
      

  6.   

    哈希表,由HASHCODE产生,很多地方用的着的
    哈希表是也,和数组差不多的一种数据结构.比如有几个人,分别有大名和小名,大名和小名是一一对应的.那么就可以用hashtable.假设以大名做标志,存小名,那么就是:
    Hashtable ht = new Hashtable();
    ht.put("大名","小名");
    取小名时:
    Object o = ht.get("大名");