// int[]转List
List<Integer> list = Arrays.stream(arr).boxed().collect(Collectors.toList());
//List转int
int[] arr = list.stream().mapToInt(Integer::valueOf).toArray();
// int[]转List
List<Integer> list = Arrays.stream(arr).boxed().collect(Collectors.toList());
//List转int
int[] arr = list.stream().mapToInt(Integer::valueOf).toArray();
本文标题:Java List
本文链接:https://www.haomeiwen.com/subject/sjfuwktx.html
网友评论