How do I convert int[] into List in Java?
int[]
List
Of course, I\'m interested in any other answer than doing it in a loop, item by it
int[] arr = { 1, 2, 3, 4, 5 }; List list = Arrays.stream(arr) // IntStream .boxed() // Stream .collect(Collectors.toList());
see this