DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Enterprise AI Trend Report: Gain insights on ethical AI, MLOps, generative AI, large language models, and much more.

2024 Cloud survey: Share your insights on microservices, containers, K8s, CI/CD, and DevOps (+ enter a $750 raffle!) for our Trend Reports.

PostgreSQL: Learn about the open-source RDBMS' advanced capabilities, core components, common commands and functions, and general DBA tasks.

AI Automation Essentials. Check out the latest Refcard on all things AI automation, including model training, data security, and more.

Related

  • Understanding Lazy Evaluation in Java Streams
  • Exploring TakeWhile and DropWhile Functions in Java
  • Optimizing Java Applications: Parallel Processing and Result Aggregation Techniques
  • Functional Approach To String Manipulation in Java

Trending

  • BPMN 2.0 and Jakarta EE: A Powerful Alliance
  • Building a Performant Application Using Netty Framework in Java
  • Architecture: Software Cost Estimation
  • Sprint Anti-Patterns
  1. DZone
  2. Coding
  3. Java
  4. Your Guide to Java Streams [Tutorials and Articles]

Your Guide to Java Streams [Tutorials and Articles]

By 
Peter Connelly user avatar
Peter Connelly
·
Dec. 09, 19 · Presentation
Like (23)
Save
Tweet
Share
43.6K Views

Join the DZone community and get the full member experience.

Join For Free

stream-in-forest

In this edition of "Best of DZone," we've compiled our best tutorials and articles on one of the most popular APIs in Java, Streams. Whether you're a beginner just looking to bring in some elements of functional programming into a Java application, or a Streams vet, we've got your back!

Before we begin, we'd like need to thank those who were a part of this article. DZone has and continues to be a community powered by contributors like you who are eager and passionate to share what they know with the rest of the world. 

Let's get started!

Overview

  • A Guide to Streams: In-Depth Tutorial With Examples by Eugen Paraschiv — Java 8 and streams: A match made in heaven, but it can be a little overwhelming. In this post, we take an in-depth look at this combination with some examples.

  • Dipping Into Java 8 Streams by Dan Newton — With a working knowledge of lambda expressions and method references, you can see how streams enable you to work with Collections while efficiently adding logic.

  • Java Streams Overview, Part 1 and Part 2 by Zoltan Raffai — Get started working with Streams and learn everything you need to get started with basic classes, reading and writing operations, and working with errors. 

  • A Java 8 Streams Cookbook by Martin Farrell — If you're looking for a quick breakdown of Streams, look no further. This cookbook covers Streams' chief advantages, its operations, and a comprehensive example.

Processing Collections

  • Process Collections Easily With Stream in Java 8 by Leona Zhang — Learn how you can process collections easily with Stream in Java 8.

  • How to Compare List Objects in Java 7 vs. Java 8 by Arpan Das — In this blast from the not-too-distant past, we compare how Java 8's Stream API changed how you can compare List objects.

  • Mastering Java 8 Streams Part 1 and Part 2 by Marco Behler — Want to get your feet wet with Java streams? This introductory video will get you creating streams and performing simple tasks on them.

  • Convert a List to a Comma-Separated String in Java 8 by Mario Pio Gioiosa — This quick tutorial shows you how to use streams in Java to convert the contents of a list to a comma-separated string in Java 8.

Working With Files

  • Split a File as a Stream by Peter Verhas — Curious about when you would actually use the splitAsStream method? Here's a use case of splitting a file into chunks that can be processed as streams.

  • Java 8 Stream and Lambda Expressions – Parsing File Example by Eyal Golan — See a common use case for Streams and Lambda Expressions in this article.

Parallel  Streams

  • Think Twice Before Using Java 8 Parallel Streams by Lukas Krecan — Parallelization was the main driving force behind lambdas, stream API, and others. Let's take a look at an example of stream API.

  • Should I Parallelize Java 8 Streams? by Santhosh Krishnan — What do we need to consider before parallelizing Java streams?

Streams and Collectors 

  • Using Java Streams and Collectors by Jay Sridhar — This short guide covers how to use Java 8 Streams and Collectors to slice and dice lists, including computing sums, averages, and partitioning.

  • How to Use Java Stream Collectors by Yogen Rai — Want to learn more about using Java Stream collectors? Check out this post on collectors and how to use them.

  • How to Transform Elements In a Stream Using a Collector by Hubert Klein Ikkink — Learn more about how to transform elements in a Stream using Java Collectors.

  • The Ultimate Guide to the Java Stream API groupingBy() Collector by Grzegorz Piwowarek — Still a bit puzzled by what the groupingBy() collector can do in the Java Stream API? Check out this guide on using the groupingBy() collector to its fullest potential.

Stream Bugs

  • Java Stream API Was Broken Before JDK 10 by Grzegorz Piwowarek — Stream API bugs can affect anyone still residing on JDK 8 and JDK 9. Click here to learn more.

Lambda Streams

  • Java Lambda Streams and Groovy Closures Comparisons by Alex Staveley — Want to learn more about the difference between in lambda streams in both Java and Groovy? Check out this post to learn more about the differences between them.

Advanced Topics 

  • Are Java 8 Streams Truly Lazy? Not Completely! by Lukas Eder — Is it always the case that streams in Java 8 are evaluated lazily? Check out this article and find a possibly surprising result.

  • Overview of Java Stream API Extensions by Piotr Mińkowski — Check out the top Java Stream API extensions offered by popular Java libraries.

  • Java Stream: Is a Count Always a Count? Part 1 and Part 2 by Per-Åke Minborg — Learn more about counts in Java streams.

  • How to Reuse Java Streams by Miguel Gamboa — Need to use your streams over and over again? Let's cover three different approaches, their benefits, and their pitfalls when recycling Java streams.

  • Become a Master of Java Streams, Part 1: Creating Streams, Part 2: Intermediate Operations, Part 3: Terminal Operations, and Part 4: Database Streams, Part 5: Turn Joined Database Tables Into a Stream, and Part 6: Creating a New Database Application Using Streams by Per-Åke Minborg and Julia Gustafsson — Want to become a Java Streams Master?

  • Exception Handling in Java Streams by Brian Vermeer — When you want to use a method that throws a checkedException, you have to do something extra if you want to call it in a lambda.

  • Peeking Inside Java Streams With Stream.peek by Dustin Marx — How to use the Stream.peek(Consumer) method in Java to help visualize stream operations.

Be a Part of the Conversation!

Think we missed something? Want to contribute? Let us know in the comments below... or, join the conversation by becoming a member of our community of thousands of developers eager to share their knowledge and passion for programming with others.


Further Reading

  • The Best of Java Collections [Tutorials].
  • The Complete Apache Spark Collection [Tutorials and Articles].
Stream (computing) Java (programming language)

Opinions expressed by DZone contributors are their own.

Related

  • Understanding Lazy Evaluation in Java Streams
  • Exploring TakeWhile and DropWhile Functions in Java
  • Optimizing Java Applications: Parallel Processing and Result Aggregation Techniques
  • Functional Approach To String Manipulation in Java

Partner Resources


Comments

ABOUT US

  • About DZone
  • Send feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: