I tried the following snippet of Java 8 code with peek
.
List list = Arrays.asList(\"Bender\", \"Fry\", \"Leela\");
list.stream().p
The documentation for peek
says
Returns a stream consisting of the elements of this stream, additionally performing the provided action on each element as elements are consumed from the resulting stream. This is an intermediate operation.
You therefore have to do something with the resulting stream for System.out.println
to do anything.