import java.util.Enumeration;
import 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()) {
文字列 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.