DoublePredicate
represents a predicate, which is a boolean-valued function,
of one double-valued argument.
This is the double-consuming primitive type specialization of Predicate
.
The following example shows how to use DoublePredicate
.
import java.util.function.DoublePredicate; //from w w w. j a v a2s .com public class Main { public static void main(String[] args) { DoublePredicate dp = (d) -> d > 0; System.out.println(dp.test(0.5)); } }
The code above generates the following result.