方法如下:
Map<String, Integer> map = new HashMap<String, Integer>(){
{
put(“first”,1);
put(“second”,2);
put(“third”,3);
}
};
如何给map赋初始值
最新推荐文章于 2024-07-08 11:19:14 发布
方法如下:
Map<String, Integer> map = new HashMap<String, Integer>(){
{
put(“first”,1);
put(“second”,2);
put(“third”,3);
}
};