DoublePredicate example

Description

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.

Example

The following example shows how to use DoublePredicate.


import java.util.function.DoublePredicate;
/*from   w  ww  .  jav a  2s  . c  o  m*/
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.