DoubleSupplier getAsDouble gets result from the functional interface.
getAsDouble
has the following syntax.
double getAsDouble()
The following example shows how to use getAsDouble
.
import java.util.function.DoubleSupplier; /*ww w . j av a2 s. c om*/ public class Main { public static void main(String[] args) { DoubleSupplier pi = () -> {return 3.14d;}; System.out.println(pi.getAsDouble()); } }
The code above generates the following result.