Stream Terminal Operations
Reading
Important Concepts
- Two kinds of terminal operations on streams: collectors and reducers.
- The distinction between three similar-sounding things:
-
Collection(interface for a family of data structures, includesList) -
Collector(interface for operations that turn streams into collections) -
collect()(method of Stream)
-
Things to Consider
- What are two differences between collections and streams?
- What is the role of a terminal operation in a stream?
- When you do want to use a collector to terminate a stream? When would you want to use a reducer?
- What kinds of reducers are the most common?
Your Response
What was particularly interesting, confusing, or exciting to you in this reading?