Map和Set:

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/FangX_u/article/details/77961775
1.Map<String,Object>map = new HashMap<String,Object>();

map.putAll(null)---将报错

2.Set<String> methods = getMethods();---报错

正解:

 Set<String> methods= new HashSet<String>();
 methods.addAll(getMethods());




猜你喜欢

转载自blog.csdn.net/FangX_u/article/details/77961775