IntPredicate and returns a composed predicate that represents a short-circuiting logical AND of this predicate and another.
and
has the following syntax.
default IntPredicate and(IntPredicate other)
The following example shows how to use and
.
import java.util.function.IntPredicate; /*from w ww .j a v a2s .co m*/ public class Main { public static void main(String[] args) { IntPredicate i = (x)-> x < 0; IntPredicate j = (x)-> x == 0; System.out.println(i.and(j).test(123)); } }
The code above generates the following result.