首页 > 其他 > 详细

stream 的方式遍历

时间:2019-03-28 11:07:47      阅读:214      评论:0      收藏:0      [点我收藏+]

//        // 获取空字符串的数量
//        int count = (int) strings.parallelStream().filter(string -> string.isEmpty()).count();
//        System.out.println(count);
        List<String> string1 = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");
        List<String> string2 = Arrays.asList("abc","bdc","jsdfskl");
        //找出abc
        string1.stream().forEach( E -> {
            string2.stream().forEach(a-> {
                if (E.equals(a)) {
                    System.err.println(a);
                }
            });
        }
                );
       

stream 的方式遍历

原文:https://www.cnblogs.com/xiaowoniulx/p/10613390.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!