为什么当我从得到一个列表LongStream用Collectors.toList()了一个错误,但有Stream没有错误?
例子 :
错误:
Something.mapToLong(Long::parseLong).collect(Collectors.toList())
Run Code Online (Sandbox Code Playgroud)
正确:
Something.map(Long::valueOf).collect(Collectors.toList())
Run Code Online (Sandbox Code Playgroud)