hashtable用法

 import java.util.Hashtable;
public class HashTable {
public static void main (String[] args)
{
Hashtable<String,Object> ht=new Hashtable<String,Object>();
ht.put("xiao wang", 30);
ht.put("zhang san", "aaa");
ht.put("he hai", true); System.out.println(ht.size());
ht.remove("zhang san");
System.out.println(ht.size()); System.out.println(ht.get("he hai"));
ht.put("he hai", "hello");
System.out.println(ht.get("he hai"));
}
}
上一篇:一行命令创建 http-server


下一篇:Mac下Intellij IDea发布JavaWeb项目 详解二 (新建Module)