Streams

Java streams: pipelines over a source, lazy evaluation, map and flatMap, collectors, single use, and when parallel streams pay.

  • 10 cards
  • 6 questions
  • About 11 min
  • Intermediate to Advanced
Share

Streams: pipelines that take elements from a source, such as a list or a file, pass them through steps like filter and map, and end in one result. A stream is neither a collection nor a loop, and most stream bugs come from treating it as one or the other. The central idea is laziness: nothing runs until the last step asks for a result. It covers intermediate and terminal operations, a pipeline over a list and over a file, how elements flow one at a time, map and flatMap, collectors, single use, and parallel streams. It leaves out writing custom collectors and spliterators.

Contents

10 cardsnot started