Map和Set:

来源:互联网 发布:sql语句查询不重复数据 编辑:程序博客网 时间:2024/06/05 15:43
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());




原创粉丝点击