package day12;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
public class HashTest01 {
public static void main(String[] args) {
HashMap<String, String> h = new HashMap<String, String>();
h.put("apple", "사과");
h.put("strawberry", "딸기");
h.put("watermelon", "수박");
h.put("peach", "복숭아");
String v = h.get("apple");
System.out.println(v);
h.get("peach");
System.out.println(v);
h.remove("strawberry");
System.out.println(h);
System.out.println(h.size());
Set<String> keys = h.keySet();
Iterator<String> it = keys.iterator();
while(it.hasNext()) {
String key = it.next();
String value = h.get(key);
System.out.println("{" + key + ":" + value + "}");
}
}
}