package com.map;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public class MapTraversal {
public static void main(String[] args) {
Map<String, String> countries = new HashMap<>();
contries.put("中国", "北京");
contries.put("美国", "华盛顿");
contries.put("韩国", "首尔");
System.out.println("解放后。。。。。。");
Set<Entry<String,String>> countryAndCity = countries.entrySet();
for(Entry e :contryAndCity){
if(e.getKey().equals("韩国")){
e.setValue("北京");
}
System.out.print(e.getKey()+":"+e.getValue()+" ");
}
}
}