Stream.noneMatch()
Stream流的noneMatch()方法返回此流中是否没有元素与提供的谓词匹配。如果流中没有元素匹配提供的谓词,或者流为空,则该方法返回true。比如:Stream stream = Stream.of(1,2,3,4);boolean b = stream.noneMatch(s -> (int)s>4);System.out.println("返回结果-----" + b); //true例子中,流里面没有大于4的元素,返回true;...
原创
2021-12-17 14:47:30 ·
5766 阅读 ·
0 评论