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文档自己看.
解决方案 »
- 怎么把string转换成file
- JSP提问
- 基础:操作符的问题,请指教!!
- 【诚恳求教】--如何用【TableModel】结合【JFileChooser】来更新【JTable】的内容?谢谢!
- 一个关于接口的问题
- 请问有谁有windows200下oracle,mysql的jdbc驱动
- 我用jdbc取mssqlserver中文数据的时候为什么全是乱码?我已经做了字符转换了呀
- 难道中国程序员真的是XXXX?没人能够回答这个问题??第三次提问! 100分送上!
- 谁能把java2核心高级特性的源代码mail一份给我或者给我一个能在www.phptr.com下载的password
- vaj的安装!
- 本站论坛诚招“版主”一名
- JTable刷新?
to xiaofenguser(风雨):不要都把别人当菜鸟嘛!!??虽然偶真的是Java菜鸟....但DOC还是知道的,要不是E文不过关....
[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.
呵呵,没说你是菜鸟,我也才学不多长时间,也是菜鸟一只.
只是告诉你去哪儿查,E文不行么,我告诉你我在高中英语就一直没及格过
DOC上的E文不是很难看,如果你不学会看DOC你永远都只能停留在别人告诉你的阶段,还是下点功夫去看DOC吧
哈希表是也,和数组差不多的一种数据结构.比如有几个人,分别有大名和小名,大名和小名是一一对应的.那么就可以用hashtable.假设以大名做标志,存小名,那么就是:
Hashtable ht = new Hashtable();
ht.put("大名","小名");
取小名时:
Object o = ht.get("大名");