java语言

Map<String,Object> map = new HashMap<String,Object>();
map.put("str1", "内容1");
map.put("str2", "内容1");
map.put("str3", "内容1");
map.put("str4", "内容1");
Set<Map.Entry<String, Object>> set = map.entrySet();
Iterator<Map.Entry<String,Object>> iter = set.iterator();
while(iter.hasNext()){
Map.Entry<String, Object> entry = iter.next();
System.out.println(entry.getKey()+"--->"+entry.getValue());
}

你可能感兴趣的:(java语言)