DoubleBinaryOperator applyAsDouble example

Description

DoubleBinaryOperator applyAsDouble method applies this operator to the given operands.

Syntax

applyAsDouble has the following syntax.


double applyAsDouble(double left,  double right)

Example

The following example shows how to use applyAsDouble.


import java.util.function.DoubleBinaryOperator;
//www. j  av  a2  s .  c om
public class Main {
  public static void main(String[] args) {
    DoubleBinaryOperator d = (x,y) -> x*y;
    System.out.println(d.applyAsDouble(0.23, 0.45));
  }
}

The code above generates the following result.