Java Arena

Module 37

Streams and lambdas

Streams, a second way to go through a collection's values. stream(), lambda expressions and method references, terminal operations (count, sum, average, forEach, collect) and intermediate ones (filter, map, sorted, distinct, limit, skip), streams of input lines and of objects, reduce and IntStream, reading a file's lines as a stream, and when a loop reads better than a stream. MOOC section 10.1.

Steps

  1. Why streams: filter and count
  2. Lambda expressions and method references
  3. Ending a stream: count, sum, average, collect
  4. Steps in the middle: map, sorted, distinct, limit, skip
  5. Streams of input
  6. Streams of objects
  7. reduce, and IntStream
  8. Reading a file as a stream
  9. A loop or a stream?