공부/Java

Java_12_Convert int[] to List

오피스엑소더스 2019. 5. 29. 09:04

1. int[] -> List

1
2
3
4
5
int[] d = {1,2,3,4,5};
        
List<Integer> lst = new ArrayList<>();
        
lst = IntStream.of(d).boxed().collect(Collectors.toCollection(ArrayList::new));
cs