DoubleBinaryOperator example

Description

DoubleBinaryOperator represents an operation on two double-valued operands and producing a double-valued result.

Example

The following example shows how to use DoubleBinaryOperator.


import java.util.function.DoubleBinaryOperator;
// w  w w  . jav a 2 s  .  co m
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.