mapToInt

왕감자·2025년 2월 21일

2025 내일배움캠프

목록 보기
28/39
return ans.stream().mapToInt(i -> i).toArray();
  • mapToInt(i -> i) : Integer를 int로 변환

==

int[] result = new int[ans.size()];
for (int i = 0; i < ans.size(); i++) {
    result[i] = ans.get(i);
}
return result;

0개의 댓글