Why is `Stream.collect` type-safe and `Stream.toArray(IntFunction)` is not?

前端 未结 1 1369
感动是毒
感动是毒 2020-12-30 02:43

Consider the following code fragment

String strings[] = {\"test\"};
final List collect = java.util.Arrays.stream(strings).collect(java.util.str         


        
1条回答
提交回复
热议问题