LongSupplier getAsLong example

Description

LongSupplier getAsLong gets a result.

Syntax

getAsLong has the following syntax.


long getAsLong()

Example

The following example shows how to use getAsLong.


import java.util.function.LongSupplier;
//from   w ww . j  a va2  s  . c om
public class Main {

  public static void main(String[] args) {
    LongSupplier i = () -> Long.MAX_VALUE;
    
    System.out.println(i.getAsLong());
  }
}

The code above generates the following result.