![]() |
VOOZH | about |
The DoublePredicate interface was introduced in JDK 8. This interface is packaged in java.util.function package. It operates on a Double object and returns a predicate value based on a condition. It is a functional interface and thus can be used in lambda expression also.
public interface DoublePredicate
Methods
boolean test(double value)
default DoublePredicate and(DoublePredicate other)
default DoublePredicate negate()
default DoublePredicate or(DoublePredicate other)
Example:
100 is less than 100 false 100 is greater than 100 false 81 is less than 100 true 49 is greater than 36 and less than 100 true
Reference: https://docs.oracle.com/javase/8/docs/api/java/util/function/DoublePredicate.html