런타임:
package com.codeurjava.hashtable;
import java.util.*;
public class hashtable_put {
public static void main(String args[]) {
// 해시 테이블 생성
해시 테이블 ht = new Hashtable();
// 피어 삽입
ht.put(1, "A");
ht.put(2, "B");
ht.put(3, "C");
System.out.println("수정 전 해시 테이블: "+ht);
// 2
String val_ret=(String)ht.put(2,"BB");
System.out.println("대체된 값: "+val_ret);
System.out.println("수정 후 해시 테이블: "+ht);
}
}
초기 해시 테이블 값: {3=C, 2=B, 1=A}
대체된 값: B
새 해시 테이블: {3=C, 2=BB, 1=A}
ht.replace(2,"B", "비비");Ressources:
Please disable your ad blocker and refresh the window to use this website.