- forEach operation on stream applies a consumer function to each item in the stream.
int stream one to three
IntStream oneToThree = IntStream.of(1, 2, 3);
integer consumer
USAGE
IntConsumer integerConsumer = i -> log.info(""+i);
USAGE
log.info("applying forEach operation to oneToThree stream");
oneToThree.forEach(integerConsumer);
Comments
Post a comment