方法如下:
Map<String, Integer> map = new HashMap<String, Integer>(){
{
put("first",1);
put("second",2);
put("third",3);
}
};
如何给map赋初始值
最新推荐文章于 2025-01-08 20:16:30 发布
方法如下:
Map<String, Integer> map = new HashMap<String, Integer>(){
{
put("first",1);
put("second",2);
put("third",3);
}
};
2911
782

被折叠的 条评论
为什么被折叠?