IntToLongFunction applyAsLong example

Description

IntToLongFunction applyAsLong applies this function to the given argument.

Syntax

applyAsLong has the following syntax.


long applyAsLong(int value)

Example

The following example shows how to use applyAsLong.


import java.util.function.IntToLongFunction;
// ww  w  .j  a va 2 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.