---
title: "Discussion on \"How Does the “forEach()” Loop Work in Java?\" | Hashnode"
description: "Discussion on \"How Does the “forEach()” Loop Work in Java?\". This article will provide with you great examples of how the forEach loop works on Collections and Streams."
url: "https://hashnode.com/posts/how-does-the-foreach-loop-work-in-java/61758ea90c5e175a1c617c1c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How Does the “forEach()” Loop Work in Java?](https://techwithmaddy.com/how-does-the-foreach-loop-work-in-java?utm_source=hashnode&utm_medium=feed)

This article will provide with you great examples of how the forEach loop works on Collections and Streams.

Oct 24, 2021 · 4 min read · techwithmaddy.com  
Updated Oct 20, 2023  
Read the article

-   [#java](https://hashnode.com/tag/java)
-   [#functional-programming](https://hashnode.com/tag/functional-programming)
-   [#features](https://hashnode.com/tag/features)

## Written by

[Maddy](https://hashnode.com/@Maddy25)

@Maddy25 · London, UK

  
[View profile](https://hashnode.com/@Maddy25)

Technical Writer @ Cloudflare

Software engineer turned technical writer.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
