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.

Method

  1. ObjLongConsumer accept

Example

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("java2s.com ",Long.MAX_VALUE);
  }
}

The code above generates the following result.