In order to convert an Integer array to a list of integer I have tried the following approaches:
Initialize a list(Integer type), iterate over the array and insert into the list
By using Java 8 Streams:
int[] ints = {1, 2, 3}; List<Integer> list = new ArrayList<Integer>(); Collections.addAll(list, Arrays.stream(ints).boxed().toArray(Integer[]::new));
Which is better in terms of performance?
See Question&Answers more detail:os