list 地图中的value获取
list map中的value获取
//list中的数据可以用iterate获取,也可以循环,但是map values中的只能用iterate collection
Map map = new HashMap<Integer, String>();
map.put(1, "frist");
map.put(2, "second");
Collection con = map.values();
Iterator ite = con.iterator();
while(ite.hasNext()) {
System.out.println(ite.next());
}
//list中的数据可以用iterate获取,也可以循环,但是map values中的只能用iterate collection
Map map = new HashMap<Integer, String>();
map.put(1, "frist");
map.put(2, "second");
Collection con = map.values();
Iterator ite = con.iterator();
while(ite.hasNext()) {
System.out.println(ite.next());
}