提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
从哈希表中删除所有值
import java.util.Hashtable; /* 来 自* nowjava.com */ public class Main { public static void main(String[] args) { Hashtable ht = new Hashtable(); ht.put("1","One"); ht.put("2","Two"); ht.put("3","Three"); ht.clear(); System.out.println("Total key value pairs in Hashtable are : " + ht.size()); } }