Map<Integer, String> map = new TreeMap<Integer, String>();//TreeMap本身具有排序功能(默认按键升序排序)
map.put(12, "hello");
map.put(7, "bravestarr");
map.put(20, "world");
System.out.println(map.toString());
打印结果