使用Stream List list = new ArrayList<>(); int[] arr = list.stream().mapToInt(Integer::valueOf).toArray();