Java Lambda - ObjLongConsumer accept example








ObjLongConsumer accept performs this operation on the given arguments.

Syntax

accept has the following syntax.

void accept(T t, long value)

Example

The following example shows how to use accept.

import java.util.function.ObjLongConsumer;
/*ww w .j a v  a2 s  . c  o  m*/
public class Main {

  public static void main(String[] args) {
    ObjLongConsumer<String> i  = (s,d)->System.out.println(s+d);
    
   
    i.accept("java2s.com ",Long.MAX_VALUE);
  }
}

The code above generates the following result.