The following code shows how to pass IntConsumer as parameter.
import java.util.function.IntConsumer; // ww w . j a v a 2 s .co m public class Main { public static void start(IntConsumer cons, int d) { cons.accept(d); } public static void main(String[] args) { start(e -> System.out.print("Release year: " + e), 2013); } }
The code above generates the following result.