Java int[] ๋ฐฐ์ด List<Integer>๋ก ๋ณํ
public static void main(String[] args) {
int[] arr = {93, 30, 55};
List<Integer> list = Arrays.stream(arr).boxed().collect(Collectors.toList());
System.out.println(Arrays.toString(arr));
System.out.println(list);
}
๊ฒฐ๊ณผ
Java 8 ์ด์์์๋ง ๋๋ค๊ณ ํฉ๋๋ค.
'Java' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Java ์๋ฐ ๋ํผ ํด๋์ค (0) | 2021.06.27 |
---|---|
Java ์๋ฐ List<Integer> ๋ฆฌ์คํธ๋ฅผ int[] ๋ฐฐ์ด๋ก ๋ฐ๊พธ๊ธฐ (0) | 2021.06.08 |
๊ฐ์ฒด ์งํฅ ์ํ ์ฒด์กฐ ์์น (0) | 2021.05.31 |
Java split()๊ณผ StringTokenizer ์ฐจ์ด (0) | 2021.01.15 |
๋ฐฑ์ค ์๋ฐ ์ฝ๋ ์ ์ถ ํ ํ๋ฆฟ (0) | 2020.12.28 |