用arrays.aslist()有问题 数组一行代码转list
int[] nums = {1,1,1,2,2,2}; List<Integer> li = Arrays.stream( nums ).boxed().collect(Collectors.toList());
int[]只有先转list才可以转set set不转list可以用iterate迭代取值,也可以转list后取值
int[] nums = {1,1,1,2,2,2}; List<Integer> collect = Arrays.stream(nums).boxed().collect(Collectors.toList()); HashSet<Integer> t = new HashSet<>(collect );
LinkedList<Integer> list = new LinkedList<>(t);