提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
获取哈希表的大小
import java.util.Hashtable; /** from * 时 代 J a v a - N o w J a v a . c o m **/ public class Main { public static void main(String[] args) { Hashtable ht = new Hashtable(); System.out.println("Size of Hashtable : " + ht.size()); //add key value pairs to Hashtable using put method ht.put("1","One"); ht.put("2","Two"); ht.put("3","Three"); System.out.println("Size of Hashtable after addition : " + ht.size()); Object obj = ht.remove(