</>CodexBash
All articles
Java and Spring

Java streams

Process collections declaratively with the Stream API: creating streams, filter, map and sorted, collecting to lists, maps and groups, reducing, primitive streams, Optional results, laziness, and the mistakes that make streams slow or wrong.

CodexBash, , 4 min read

Since Java 8, the Stream API lets you describe what to do with a collection, filter these, transform those, group by this, rather than writing the loop that does it. Done well, stream code reads like a sentence describing the result. Done badly, it hides bugs and costs performance. This article covers the operations you will use daily and the habits that keep streams clear.

Sign in to read the rest

The whole 4 minute article is free with an account, along with every problem, lesson and tutorial. No card.