Java Lambda - LongFunction apply example

LongFunction apply applies this function to the given argument.


apply has the following syntax.

R apply(long value)


The following example shows how to use apply.

import java.util.function.LongFunction;
/*from w w  w  .  j  av  a  2  s.  c o m*/
public class Main {

  public static void main(String[] args) {
    LongFunction<String> i = (l) -> Long.toString(l);

The code above generates the following result.