
1个回答
展开全部
Map的键是任意类型的
null不是类型 ,任何泛型都可以容纳null。
Map<Integer,Integer> intintMap = new HashMap<>();
intintMap.put(1,null);是可以的;
null不是类型 ,任何泛型都可以容纳null。
Map<Integer,Integer> intintMap = new HashMap<>();
intintMap.put(1,null);是可以的;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询