IntConsumer accept performs this operation on the given argument.
accept
has the following syntax.
void accept(int value)
The following example shows how to use accept
.
import java.util.function.IntConsumer; // w ww . jav a2 s. c om public class Main { public static void main(String[] args) { IntConsumer ic = (x)->System.out.println(x); ic.accept(3); } }
The code above generates the following result.