Issue
In the Java Stream API definition, it says "Stream API is used to process collections of objects. A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired result".
In this definition what is the meaning of pipelined?
Solution
pipelined : like the production line in a factory . Operations (methods) are the employees , every employee (method/operation) do his job and pass the product to the next employees to do their works .
Example :
....filter(...).map(...).collect(...);
An employee will filter the stream , and pass the filtered elements to the next employee , the next will map the products ( replace the product with another thing ) , the last employee will collect the results and give us the final "collection" of products.
Answered By - Oussama ZAGHDOUD

0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.