一个小例子,说明下map类型的便利,以hashmap为例,其他的map大同小异。
Map m = new HashMap();
m.put("1","a");
m.put("2","b");
m.put("3","c");
m.put("4","d");
m.put("5","e");
m.put("6","f");
m.put("1","a");
for(Iterator it = m.keySet().iterator();it.hasNext();){
System.out.println(m.get(it.next()));
}
819




被折叠的 条评论
为什么被折叠?



