// TreeMap的输入与输出的排序是一样。
public class TestMap3 {
public static void main(String[] args){
TreeMap tm=new TreeMap();
tm.put("a", 1);
tm.put("b", 2);
tm.put("c", 3);
TreeMap tm2=new TreeMap();
tm2.put("d", 4);
tm2.put("e", 5);
tm2.put("f", 6);
tm2.putAll(tm);
Iterator ite=tm2.entrySet().iterator();
while(ite.hasNext()){
Entry entry=(Entry)ite.next();
System.out.print(entry.getKey()+"/");
System.out.println(entry.getValue());
}
}
}