方法如下:
Map<String, Integer> map = new HashMap<String, Integer>(){
{
put(“first”,1);
put(“second”,2);
put(“third”,3);
}
};
如何给map赋初始值
最新推荐文章于 2023-06-01 15:37:04 发布
方法如下:
Map<String, Integer> map = new HashMap<String, Integer>(){
{
put(“first”,1);
put(“second”,2);
put(“third”,3);
}
};