1 Map<Integer,String> map = new LinkedHashMap<Integer,String>(); 2 map.put(1, "星期一"); 3 map.put(2, "星期二"); 4 map.put(3, "星期三"); 5 map.put(4, "星期四"); 6 map.put(5, "星期五"); 7 map.put(6, "星期六"); 8 map.put(7, "星期日"); 9 10 for(Map.Entry<Integer, String> entry: map.entrySet()) { 11 System.out.print(entry.getKey() + ":" + entry.getValue() + "\t"); 12 }
时间: 2024-10-08 10:27:45