LongConsumer accept example

Description

LongConsumer accept performs this operation on the given argument.

Syntax

accept has the following syntax.


void accept(long value)

Example

The following example shows how to use accept.


import java.util.function.LongConsumer;
// w  ww . j a v  a 2 s. c om
public class Main {

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

The code above generates the following result.