Java Lambda - ToDoubleBiFunction example








ToDoubleBiFunction represents a function that accepts two arguments and produces a double-valued result. This is the double-producing primitive specialization for BiFunction.

Method

  1. ToDoubleBiFunction applyAsDouble

Example

The following example shows how to use ToDoubleBiFunction.

import java.util.function.ToDoubleBiFunction;
/*w w  w .  j av a  2  s  .  c om*/
public class Main {

  public static void main(String[] args) {
    ToDoubleBiFunction<Integer,Long> i  = (x,y)-> Math.sin(x)+Math.sin(y);
    
    System.out.println(i.applyAsDouble(Integer.MAX_VALUE, Long.MAX_VALUE));
  }
}

The code above generates the following result.