请问各位大神 Map<String,Integer> 怎么转 Map<String,object>

发布网友 发布时间: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.

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com