ToDoubleFunction applyAsDouble example

Description

ToDoubleFunction applyAsDouble applies this function to the given argument.

Syntax

applyAsDouble has the following syntax.


double applyAsDouble(T value)

Example

The following example shows how to use applyAsDouble.


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

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

The code above generates the following result.