package ZHANG.API;
import java.util.Hashtable;
public class HashTable {
public static void main(String[] args) {
Hashtable num = new Hashtable();
num.put("yi",new Integer(1));
num.put("er", new Integer(2));
num.put("san", new Integer(3));
Integer n = (Integer) num.get("er");
System.out.println("er ="+n);
System.currentTimeMillis();
}
}
本文提供了一个 Java 中使用 Hashtable 类的简单示例。通过创建 Hashtable 实例并进行增删查操作,展示了如何利用 Hashtable 存储和检索键值对数据。
1558

被折叠的 条评论
为什么被折叠?



