How can you terminate a stream? How can you summarize a stream into a single object?
- [Instructor] Hi.…Welcome to the video on basic terminal operations.…In this video we will describe…the simplest terminal operations for streams.…They perform a variety of different tasks, such as,…some of them extract a single element from the stream.…Others put all elements in an array.…One very common operation just counts…the number of elements in the stream.…
Other operations check a boolean condition on the stream…and return a single boolean value.…Finally, a couple of terminal operations allow us…to execute arbitrary code on each element.…The API provides a number of different terminal operations.…We can partition them according to their return type.…First we have a couple of operations that return voids.…
We have already met two of them.…They are forEach and forEachOrder.…We've used them in most of our previous examples.…I'm going to present in the same category also an operation…which is not terminal, it's an intermediate operation.…It's called peek, but its behavior is very similar…to these other two terminal operations.…
Note: To get the best results from this course, you should be familiar with basic Java programming concepts, including lists, maps, and sets, and have a suitable IDE, such as Eclipse, NetBeans, or IntelliJ.
This course was created and produced by Packt Publishing. We are honored to host this training in our library.
- What is functional programming?
- What are functional interfaces?
- Writing lambda expressions
- Creating functional interfaces
- Composing functions
- Sequential data processing with streams
- Using parallel streams