// anyMatch():判断stream流中是否有符合匹配规则的元素,有返回true,没有返回false
List<Long> list1= new ArrayList<>();
List<Long> list2= new ArrayList<>();
list1 = list1.stream().filter(m1 ->
list2.stream().anyMatch(m2 ->
m1 == m2)).collect(Collectors.toList());
两stream流嵌套循环
猜你喜欢
转载自blog.csdn.net/A_234_789/article/details/108417050
今日推荐
周排行