the article was good but forEach is not really part of streams. it is an implementation of the functional or iterable interface and can be used for any list even without a stream.
List.stream().forEach would be less performing than List.forEach if used directly. If you use Filter and Map operations before forEach its a benefit to use it on Streams.
I'm Abhinava Ghosh, a Computer Science and Engineering Student who is passionate about simplifying things through technology. I work with all kinds of modern Java,Android and JavaScript Applications.
the article was good but forEach is not really part of streams. it is an implementation of the functional or iterable interface and can be used for any list even without a stream.
List.stream().forEach would be less performing than List.forEach if used directly. If you use Filter and Map operations before forEach its a benefit to use it on Streams.
agreed!
Actually we use .forEach() so frequently with Streams that i thought of mentioning it, under Streams.