int 5b 5d array to integer 5b 5d array

Solutions on MaxInterview for int 5b 5d array to integer 5b 5d array by the best coders in the world

showing results for - "int 5b 5d array to integer 5b 5d array"
Chelsea
12 Jul 2019
1int[] primitiveArray = { 1, 2, 3, 4, 5 };
2 
3Integer[] boxedArray = Arrays.stream(primitiveArray) // IntStream
4  .boxed()                // Stream<Integer>
5  .toArray(Integer[]::new);
6
7System.out.println(Arrays.toString(boxedArray));