If a thread-safe implementation is not needed, it is recommended to use HashMap in place of code Hashtable. If a thread-safe highly-concurrent implementation is desired, then it is recommended to ...
一.HashMap 和Hashtable 的区别
我们先看2个类的定义
public class Hashtable
extends Dictionary
implements Map, Cloneable, java.io.Serializable
public class HashMap
extends Abstract...
代码:
import java.util.*;
public class test{
public static void main(String[] args)
{
HashMap hm = new HashMap();
hm.put(null,null);
hm.put(null,null);
...