Grokking Java Interview Questions
0% completed
Stream Pipelines and Lazy Evaluation
pipeline built map apple map banana map cherry found CHERRY
A program takes eight product names, converts each one to upper case, and asks for the first name that starts with the letter C. Its conversion function prints a line for each call. Why did the conversion start only after the message pipeline built, and why were five of the eight names never converted?
The answer to both parts is the same property of streams. The four questions below describe what a stream is, when its operations run, how some operations end the work early, and why a stream serves one traversal only
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%