📅  最后修改于: 2022-03-11 14:52:35.439000             🧑  作者: Mango
int[] primitiveArray = { 1, 2, 3, 4, 5 };
Integer[] boxedArray = Arrays.stream(primitiveArray) // IntStream
.boxed() // Stream
.toArray(Integer[]::new);
System.out.println(Arrays.toString(boxedArray));