BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] input = Arrays.stream(br.readLine().split(" "))
.mapToInt(Integer::parseInt)
.toArray();
1 2
입력받았을 때 input[0] = 1, input[1] = 2 저장ArrayList<Integer>
-> int[]
ArrayList<Integer> list = new ArrayList<>();
int[] arr = list.stream()
.mapToInt(d -> d)
.toArray();
또는
int[] arr = list.stream()
.mapToInt(Integer::intValue)
.toArray();