IntPredicate
represents a predicate, which is a boolean-valued function,
of one int-valued argument.
This is the int-consuming primitive type specialization of Predicate
.
The following example shows how to use IntPredicate
.
import java.util.function.IntPredicate; /*from w ww. j av a 2s . c o m*/ public class Main { public static void main(String[] args) { IntPredicate i = (x)-> x < 0; System.out.println(i.test(123)); } }
The code above generates the following result.