import java.util.Enumeration;
导入 java.util.Hashtable;
public class main {
public static void main(String[] s) {
哈希表<字符串,字符串>ht = 新哈希表<字符串,字符串>();
ht.put(k1”, a”);
ht.put(k2”, b”);
ht.put(k3”, c”);
ht.put(k4”, d”);
对象 ancien_valeur = ht.put(k4”, e”);Runtime:
System.out.println(k4 键的旧值是:”+ancien_valeur);
枚举 e = ht.keys();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
System.out.println(key + : ” + ht.get(key));
}
}
}
k4 键的旧值为:e资源:
k4: d
k3: c
k2: b
k1: a
Please disable your ad blocker and refresh the window to use this website.