Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions concepts/streams/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# About Streams

Java Streams provide a functional, declarative approach to processing collections of data.

Instead of writing explicit loops, Streams let you build **pipelines** of operations — transforming data step-by-step in a clean, readable way.

---

### Creating Streams
Streams can be created from collections, arrays, or I/O channels:
```java
List<Integer> numbers = List.of(1, 2, 3, 4, 5);
Stream<Integer> stream = numbers.stream();
6 changes: 6 additions & 0 deletions concepts/streams/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"blurb": "Learn how to use Java Streams for functional and declarative data processing.",
"authors": ["Zaildar_Anmol"],
"contributors": [],
"forked_from": null
}
22 changes: 22 additions & 0 deletions concepts/streams/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Introduction

The `Stream` API, introduced in Java 8, provides a modern, functional way to process data.

A **Stream** is a sequence of elements that supports operations like filtering, mapping, and reducing.
It allows you to transform and analyze collections without using traditional loops.

Example:
```java
import java.util.*;
import java.util.stream.*;

public class Example {
public static void main(String[] args) {
List<String> names = List.of("Arjun", "Riya", "Sam", "Aman");

names.stream()
.filter(n -> n.startsWith("A"))
.map(String::toUpperCase)
.forEach(System.out::println);
}
}