Stream Collectors - toCollection_streamcollect(collectors.tocollection())-CSDN博客

网站介绍:文章浏览阅读2.5k次。public static <T,​C extends Collection<T>> Collector<T,​?,​C> toCollection​(Supplier<C> collectionFactory)简述一下就是把集合中的元素转换成参数指定的集合类型进行保存。看个例子:void test42() { List<Integer> list = List.of(2,5,8,9,4,20,11,43,55);..._streamcollect(collectors.tocollection())