📜  int[] 数组到 Integer[] 数组 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:35.439000             🧑  作者: Mango

代码示例1
int[] primitiveArray = { 1, 2, 3, 4, 5 };
 
Integer[] boxedArray = Arrays.stream(primitiveArray) // IntStream
  .boxed()                // Stream
  .toArray(Integer[]::new);

System.out.println(Arrays.toString(boxedArray));