J2EEOnlineJ2EE 





Java Streams  «Prev 

Roller Coaster Java Stream Analogy

Picture a line of people waiting to get on a roller coaster. As people get on the roller coaster, more people are added at the back of the line. If it's a slow day, the roller coaster may catch up with the end of the line and have to wait for people to board.
Other days, there may always be people in line until the park closes.
Each person is a discrete individual and must be put on the roller coaster or not put on the roller coaster. There are no half-people. There is always a definite number of people in line, though this number may change from moment to moment as people enter at the back of the line and exit from the front of the line.
Although all the people are discrete, you will sometimes have a family that must be put together in the same car. Thus even though the individuals are discrete, they are not necessarily unrelated.



Final Destination Roller Coaster