IntStream noneMatch(IntPredicate predicate) example
Description
IntStream noneMatch(IntPredicate predicate)
returns whether no elements of this stream match the provided predicate.
Syntax
noneMatch
has the following syntax.
boolean noneMatch(IntPredicate predicate)
Example
The following example shows how to use noneMatch
.
import java.util.stream.IntStream;
/*from w w w.j a v a 2s . c o m*/
public class Main {
public static void main(String[] args) {
IntStream i = IntStream.of(6,5,7,1, 2, 3, 3);
boolean d = i.noneMatch(n-> n > 0 );
System.out.println(d);
}
}
The code above generates the following result.