I can read java stream api defination "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 defination what is the meaning of pipelined
CodePudding user response:
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.