Java Lambda - IntToLongFunction example

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.


  1. IntToLongFunction applyAsLong


The following example shows how to use IntToLongFunction.

import java.util.function.IntToLongFunction;

public class Main {

  public static void main(String[] args) {
    IntToLongFunction i = (x) -> Long.MAX_VALUE-x;

The code above generates the following result.