[Java] 纯文本查看 复制代码 Map<Integer, Map<Integer, List<String>>> map = new HashMap<Integer, Map<Integer,List<String>>>();
for(int i =0;i<10;i++){
Map<Integer, List<String>> subMap = new HashMap<Integer, List<String>>();
for(int j=0;j<10;j++){
List<String> list = new ArrayList<String>();
list.add("数据:i= "+i+" j= "+j);
subMap.put(j, list);
}
map.put(i,subMap);
}
Set<Integer> keySet = map.keySet();
for (Integer key : keySet) {
Map<Integer, List<String>> map2 = map.get(key);
Set<Integer> keySet2 = map2.keySet();
for (Integer key2 : keySet2) {
List<String> list = map2.get(key2);
System.out.println(list);
}
}
|