DoubleConsumer accept performs passedin operation on the given argument.
accept
has the following syntax.
void accept(double value)
The following example shows how to use accept
.
import java.util.function.DoubleConsumer; public class Main { public static void main(String[] args) { DoubleConsumer d = (x) -> System.out.println(x*x); d.accept(0.23); } }
The code above generates the following result.