Java Lambda - ObjLongConsumer example

ObjLongConsumer represents an operation that accepts an object-valued and a long-valued argument, and returns no result. This is the reference, long specialization of BiConsumer.


  1. ObjLongConsumer accept


The following example shows how to use ObjLongConsumer.

import java.util.function.ObjLongConsumer;
//from   w ww  . j a  va2s  . c o  m
public class Main {

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

The code above generates the following result.