For Each and Map/Reduce
Learn about the `forEach` and map/reduce method in Java 8.
We'll cover the following
For each
The most basic thing we can do with a stream is loop through it using the forEach
method.
For example, to print out all of the files in the current directory, we could do the following:
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy