发布网友 发布时间:2022-04-23 15:47
共1个回答
热心网友 时间:2023-10-08 21:13
Of course you can.
//=================================
Map<String, Integer> innerMap = new HashMap<String, Integer>();
innerMap.put("innerKey", 2014);
Map<String, Map<String,Integer>> map = new HashMap<String, Map<String, Integer>>();
map.put("outerKey", innerMap);
Map<String, Integer> targetMap = map.get("outerKey");
if(targetMap == innerMap){
System.out.println("You got the inner Map, and it is saved in targetMap!!!");
}
//=================================追问OK Thanks Although it is not the result I want, but still very grateful to you.