1 Mapmap = new LinkedHashMap (); 2 map.put("shuoji", "手机图赏"); 3 map.put("pingban", "平板电脑"); 4 map.put("bijiben", "笔记本电脑"); 5 map.put("pingguo", "苹果"); 6 map.put("xiangji", "数码相机"); 7 map.put("chaojiben", "超级本"); 8 map.put("shexiangji", "数码摄像机"); 9 10 Iterator it = map.keySet().iterator();11 while (it.hasNext()) {12 String key = (String) it.next();13 String value = map.get(key);14 System.out.println(key + ":" + value);15 }16 for (Map.Entry entry : map.entrySet()) {17 System.out.println(entry.getKey() + ":" + entry.getValue());18 }