以下实例演示了如何使用 Enumeration 类的 hasMoreElements 和 nextElement 方法来遍历输出 HashTable 中的内容:
Main.java 文件
以上代码运行输出结果为:
Three Two One