import java.util.Hashtable;Runtime:
import java.util.Map;
public class main{
public static void main(String[] args) {
ハッシュテーブル<文字列、文字列>ht = 新しいハッシュテーブル<文字列、文字列>();
ht.put("1", "one");
ht.put("2", "two");
ht.put("3", "three");
オブジェクト obj = ht.remove("2");
System.out.println(obj + " は削除されました");
System.out.println("削除後のハッシュセット:");
for (Map.Entryentry : ht.entrySet())
{
System.out.println("<"+entry.getKey()+", "+entry.getValue()+">");
}
}
}
two が削除されました参照:
削除後の HashSet:
<3、3>
<1、A>
Please disable your ad blocker and refresh the window to use this website.