Stream流操作-flatmap 【Java8-高级特性】

代码如下

String[] words = new String[]{"Hello","World"};
List<String[]> a = Arrays.stream(words)
                .map(word -> word.split(""))
                .distinct()
                .collect(toList());
a.forEach(System.out::print);

Stream的运行流程如下

 

 转载自:https://blog.csdn.net/liyantianmin/article/details/96178586

 

posted @ 2022-03-12 12:24  沾青先生  阅读(113)  评论(0编辑  收藏  举报