map与forEach的嵌套遍历,如何返回一个数组
展开全部
public static void main(String[] args) {
Map<String,Map<String,Object>> map = new HashMap<String,Map<String,Object>>();
for (String key : map.keySet()) {
for (String keyIn : map.get(key).keySet()) {
System.out.println("大MAP>>>"+map.get(key)+"小MAP>>>>>"+map.get(key).get(keyIn));
}
}
}
Map<String,Map<String,Object>> map = new HashMap<String,Map<String,Object>>();
for (String key : map.keySet()) {
for (String keyIn : map.get(key).keySet()) {
System.out.println("大MAP>>>"+map.get(key)+"小MAP>>>>>"+map.get(key).get(keyIn));
}
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询