Set occ = new HashSet<>();
List<> list = new ArrayList(occ);
与常用的List list = new ArrayList<>(); 不太一样,为两种构造方法;
也可以写List list = new ArrayList(occ); 或者List list = new ArrayList(occ);
List/Collection转换
最新推荐文章于 2024-07-14 02:58:52 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
Set occ = new HashSet<>();
List<> list = new ArrayList(occ);
与常用的List list = new ArrayList<>(); 不太一样,为两种构造方法;
也可以写List list = new ArrayList(occ); 或者List list = new ArrayList(occ);