LongFunction apply example

Description

LongFunction apply applies this function to the given argument.

Syntax

apply has the following syntax.


R apply(long value)

Example

The following example shows how to use apply.


import java.util.function.LongFunction;
/*from w  w  w. ja v a2s . co  m*/
public class Main {

  public static void main(String[] args) {
    LongFunction<String> i = (l) -> Long.toString(l);
    
    System.out.println(i.apply(Long.MAX_VALUE));
  }
}

The code above generates the following result.