DoubleUnaryOperator applyAsDouble applies this operator to the given operand.
applyAsDouble
has the following syntax.
double applyAsDouble(double operand)
The following example shows how to use applyAsDouble
.
import java.util.function.DoubleUnaryOperator; public class Main { public static void main(String[] args) { DoubleUnaryOperator dl = (x) -> {return x*x;}; System.out.println(dl.applyAsDouble(3.14)); } }
The code above generates the following result.