HashMap与HashTable的问题! HashMap与HashTable的区别是什么?分别在什么情况下选用? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 除非是处于对老版本JVM的兼容一般推荐用HashMap如果需要线程安全的话直接用Collections.synchronizedMap处理一个 楼上正解HashTable已经过时了 Thinking in java 里面的一段话:As you might expect, Hashtable performance is roughly equivalent to HashMap. (You can also see that HashMap is generally a bit faster. HashMap is intended to replace Hashtable.) 还有一个区别就是HashMap可以接受key的值为null,而Hashtable则不行 他们两个都能实现统一的map接口 HashMap的最基本的区别是能够实现一个null key对应若干null value. 这个在hashtable 是不被允许的 功能上,HashMap可以接受空值,HashTable不行;性能上,基本相同;发展商,HashMap是HashTable的替换版本,后继版本中HanshTable可能会deprecated 菜鸟在GUI遇到的一点点问题~求帮忙! java Selector 序列话问题(困扰很久) 关于table的表头不显示问题 字符类型转换问题?感谢啊 如何用变量接收bean:write的输出结果啊? 高手进!!!!装JDK的问题!!!!!!!!!!!!!! 怎么样使用java帮助 抽奖程序请教!在线等!!! 各位JAVA大侠,帮我解决一个包的问题吧 我想插入一条记录到库中,但有要判断username 是否存在于库中/(插入我以实现)<大家来看看) 对象流的求助. 老手回答: java 的基本知识
如果需要线程安全的话直接用Collections.synchronizedMap处理一个
HashTable已经过时了
As you might expect, Hashtable performance is roughly equivalent to HashMap. (You can also see that HashMap is generally a bit faster. HashMap is intended to replace Hashtable.)
HashMap可以接受key的值为null,而Hashtable则不行