Java Lambda - ObjDoubleConsumer example

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


  1. ObjDoubleConsumer accept


The following example shows how to use ObjDoubleConsumer.

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

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

The code above generates the following result.