import java.util.HashMap;
import java.util.Map;
public class ewrew {
public void pp(){
Map<String, String> map = new HashMap<String, String>();
map.put("AA", "aa");
map.put("BB", "bb");
map.put("CC", "cc");
map.put("DD", "dd");
for(Map.Entry<String, String> entry: map.entrySet())
{
//每個Entry就是map中一個key及其它對應的value被重新封裝的對象
System.out.println(entry.getKey() + " " + entry.getValue());
}
}
public static void main(String[] args) {
new ewrew().pp();
}
}
//執行結果
//AA aa
//BB bb
//CC cc
//DD dd