用Arrays.asList(int[])会变成一个List<int[]>型的list
可以用
Arrays.stream(int[]).boxed().collect(Collectors.toList());
本文介绍了一种将Java中的int数组转换为List<Integer>的方法,使用了Arrays.stream结合boxed()和collect()方法来完成转换过程。
用Arrays.asList(int[])会变成一个List<int[]>型的list
可以用
Arrays.stream(int[]).boxed().collect(Collectors.toList());
2343

被折叠的 条评论
为什么被折叠?