发布网友 发布时间:2022-04-23 15:47
共3个回答
热心网友 时间: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!!!");
}
//=================================
热心网友 时间:2023-10-08 21:13
可以,map反正就是键值对
热心网友 时间:2023-10-08 21:14
根据第一个string呗