Sobes.tech
Junior

What objects or data do we work with inside a Stream?

sobes.tech AI

Answer from AI

We work with elements of the source collection or other data sources such as:

  • Primitive data types (int, long, double) - specialized streams are used for their representation in Stream: IntStream, LongStream, DoubleStream.
  • Objects of any classes supporting sequential processing.

Stream itself does not store data; it is a pipeline for processing. Data is processed lazily (lazy evaluation) as needed, when a terminal operation is invoked.