Java Lambda - ToDoubleBiFunction applyAsDouble example








ToDoubleBiFunction applyAsDouble applies this function to the given arguments.

Syntax

applyAsDouble has the following syntax.

double applyAsDouble(T t,  U u)

Example

The following example shows how to use applyAsDouble.

import java.util.function.ToDoubleBiFunction;
/*from   w ww  . j  a va2 s .c o m*/
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.