-
Notifications
You must be signed in to change notification settings - Fork 0
Consumers
Rahul Chhabra edited this page Jun 13, 2017
·
1 revision
A consumer is a lambda interface that "consumes" all of it's arguments,i.e,it does not return anything.
TriConsumer<String, String, String> printString = (t, u, v) -> {
System.out.println(t);
System.out.println(u);
System.out.println(v);
};
printString.accept("Hello World", "How are you?", "I'm good");The three strings will be printed.
QuadriConsumer is used in the same way, except it takes four arguments.