Streams are composable, lazy enumerables.
Due to their laziness, streams are useful when working with large (or even infinite) collections. When chaining many operations with Enum
, intermediate lists are created, while Stream
creates a recipe of computations that are executed at a later moment.