我有一个方法,它采用整数列表作为参数.我目前有一个很长的列表,并希望将其转换为整数列表,所以我写道:
List<Integer> student =
studentLong.stream()
.map(Integer::valueOf)
.collect(Collectors.toList());
Run Code Online (Sandbox Code Playgroud)
但我收到一个错误:
method "valueOf" can not be resolved.
Run Code Online (Sandbox Code Playgroud)
实际上是否可以将long列表转换为整数列表?