Java Lambda - ObjDoubleConsumer accept example








ObjDoubleConsumer accept performs this operation on the given arguments.

Syntax

accept has the following syntax.

void accept(T t, double value)

Example

The following example shows how to use accept.

import java.util.function.ObjDoubleConsumer;
//from w  ww .j  ava 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("java2s.com ",0.1234);
  }
}

The code above generates the following result.