LongPredicate example

Description

LongPredicate represents a predicate (boolean-valued function) of one long-valued argument. This is the long-consuming primitive type specialization of Predicate.

Example

The following example shows how to use LongPredicate.


import java.util.function.LongPredicate;
// ww w  . j  a v  a  2 s.  co  m
public class Main {

  public static void main(String[] args) {
    LongPredicate i = (l) -> l>0;
    
    System.out.println(i.test(Long.MAX_VALUE));
  }
}

The code above generates the following result.