Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions concepts/streams/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"blurb": "Java Streams provide a powerful way to process collections using a functional approach.",
"authors": ["Navaneedan"],
"contributors": []
}

25 changes: 25 additions & 0 deletions concepts/streams/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# About

Streams in Java offer a modern, functional approach to processing data. Instead of writing verbose loops, you can build pipelines that transform collections with clarity and elegance.

Streams are built on three key components:

1. **Source** – Typically a collection like a `List` or `Set`.
2. **Intermediate Operations** – Transformations such as `filter`, `map`, or `sorted`.
3. **Terminal Operation** – Produces a result, like `collect`, `count`, or `forEach`.

```java
List<String> names = List.of("Dharshini", "Naveen", "Selena");

List<String> filtered = names.stream()
.filter(name -> name.startsWith("N"))
.collect(Collectors.toList());

// => ["Naveen"]
```


[Java Stream API Overview]:https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html
[Collectors Class]:https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html
[Java Functional Programming with Streams]:https://www.baeldung.com/java-8-streams
[Stream Operations Explained]:https://www.geeksforgeeks.org/stream-in-java/
13 changes: 13 additions & 0 deletions concepts/streams/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Introduction

Imagine you’re at an airport, watching suitcases glide past on a conveyor belt. You don’t grab every bag—you scan for yours, maybe sort by color or tag, and pick only what you need. That’s how Java Streams work.

Instead of writing loops and mutating variables, you describe *what* you want to do with the data. Want to filter out expensive items? Map names to uppercase? Count how many entries match a condition? Streams make it all feel natural.

Streams are part of Java’s functional programming toolkit. They help you write code that’s:
- **Declarative** – Focused on intent, not mechanics.
- **Composable** – Easy to chain operations.
- **Lazy** – Efficient by computing only when needed.

Once you start using streams, you’ll find yourself writing fewer loops and more elegant pipelines. It’s not just cleaner—it’s fun.

18 changes: 18 additions & 0 deletions concepts/streams/links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"url": "https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html",
"description": "Java Stream API Overview"
},
{
"url": "https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html",
"description": "Collectors Class"
},
{
"url": "https://www.baeldung.com/java-8-streams",
"description": "Java Functional Programming with Streams"
},
{
"url": "https://www.geeksforgeeks.org/stream-in-java/",
"description": "Stream Operations Explained"
}
]