IntToDoubleFunction applyAsDouble example

Description

IntToDoubleFunction applyAsDouble applies this function to the given argument.

Syntax

applyAsDouble has the following syntax.


double applyAsDouble(int value)

Example

The following example shows how to use applyAsDouble.


import java.util.function.IntToDoubleFunction;
/*  ww w  . j  a  v  a  2s . c o  m*/
public class Main {

  public static void main(String[] args) {
    IntToDoubleFunction i = (x) -> {return Math.sin(x);};
    System.out.println(i.applyAsDouble(2));
  }
}

The code above generates the following result.