String arr= "[1,2]"; List<Integer> arrList= JSON.parseArray(arr,Integer.class).stream().collect(Collectors.toList()); Integer[] intArr = ArrayUtils.toObject(arrList.stream().mapToInt(Integer::intValue).toArray());
[1,2]
不是一个有效的字符串,而且整个问题所基于的代码也不是有效的 Java 代码。 - Pelle