This repository contains the presentation slides and example Java code I created to teach my classmates about Java Streams at Pace University’s Seidenberg School of Computer Science and Information Systems.
Java Streams provide a modern, functional way to process data. Instead of writing verbose loops, Streams allow for clean, declarative, and efficient operations on collections.
This session introduced:
- What Streams are and why they’re useful
- Core operations:
map,filter,reduce,collect - How Streams improve readability and performance
- Practical examples using lists and custom objects
You can find presentation in Streams361pptx
Topics covered:
Functional Style Data Processing with Streams Methods we can use in streams Why Use Streams
import java.util.Arrays;
import java.util.List;
public class StreamExample {
public static void main(String[] args) {
List<String> names = Arrays.asList("Simone", "Annabel", "Claire", "Angeline");
// Filter names starting with 'A' and convert to uppercase
names.stream()
.filter(name -> name.startsWith("A"))
.map(String::toUpperCase)
.forEach(System.out::println);
}
}import java.util.Arrays;
import java.util.List;
public class StreamReduceExample {
public static void main(String[] args) {
List<Integer> numbers = Arrays.asList(2, 4, 6, 8);
// Sum all numbers using reduce
int sum = numbers.stream()
.reduce(0, Integer::sum);
System.out.println("Sum: " + sum);
}
}Event: In-class presentation for peers School: Pace University – Seidenberg School of Computer Science and Information Systems Goal: To introduce classmates to functional programming concepts in Java and demonstrate practical applications of Streams.
- Clone this repo
- Open the code in your IDE (IntelliJ, Eclipse, VS Code with Java)
- Compile and run each
.javafile
- Streams simplify data processing
- Learning Streams helps prepare for technical interviews