DEV Community

Discussion on: Let's talk about STREAMS !!

Collapse
jackydev profile image
JacKyDev

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.

Collapse
the_unconventional_coder profile image
ABHINAVA GHOSH (he/him) Author

agreed!
Actually we use .forEach() so frequently with Streams that i thought of mentioning it, under Streams.

Some comments have been hidden by the post's author - find out more