Consumer Interface in Java 8 | How To Use Functional Interface

preview_player
Показать описание
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference. Represents an operation that accepts a single input argument and returns no result. Unlike most other functional interfaces, Consumer is expected to operate via side-effects.

Thanks for watching , please do Subscribe !!!

#java8 #functionalinterface
Рекомендации по теме
Комментарии
Автор

Can you please tell me why I get an error when I use the {...}; from this code:
static BiPredicate<Integer, String> p3 = (height, gender) -> {height >= 140 && gender.equals("Male");};
I thought {...}; was the proper syntax to use and shouldn't cause an error even w/ one statement.

renejacques