Composing consumers

Report a typo

You have the following piece of code:

Consumer<Integer> printer = System.out::println;
Consumer<Integer> devNull = (val) -> { int v = val * 2; };

Consumer<Integer> combinedConsumer = devNull.andThen(devNull.andThen(printer));
combinedConsumer.accept(100);


What does this code print?

Enter a short text
___

Create a free account to access the full topic