IntToLongFunction example

Description

IntToLongFunction represents a function that accepts an int-valued argument and produces a long-valued result. This is the int-to-long primitive specialization for Function.

Example

The following example shows how to use IntToLongFunction.


import java.util.function.IntToLongFunction;
/*from  w ww. j  a va2  s .  co m*/
public class Main {

  public static void main(String[] args) {
    IntToLongFunction i = (x) -> Long.MAX_VALUE-x;
    System.out.println(i.applyAsLong(2));
  }
}

The code above generates the following result.