Lambda Expressions in Java: Syntax and Examples

Functional Interface Consumer

1/2

What is the output of the code?

Consumer<String> first = t -> System.out.println(t.toUpperCase());
Consumer<String> second = t -> System.out.println(t.toLowerCase());
first.andThen(second).accept("Hello world");
Comments