IntPredicate example

Description

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.

Example

The following example shows how to use IntPredicate.


import java.util.function.IntPredicate;
//from  w w w .  j  a va 2 s.c  om
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.