提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
遍历哈希表的值
//来自 n o w j a v a . c o m - 时 代 Java import java.util.Hashtable; import java.util.Enumeration; public class Main { public static void main(String[] args) { //create Hashtable object Hashtable ht = new Hashtable(); //add key value pairs to Hashtable ht.put("1","One"); ht.put("2","Two"); ht.put("3","Three"); Enumeration e = ht.elements(); /* from 时 代 J a v a - nowjava.com*/