Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Java Streams – Teaching Presentation @ Pace University

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.

📖 Overview

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

🎤 Presentation

You can find presentation in Streams361pptx

Topics covered:

Functional Style Data Processing with Streams Methods we can use in streams Why Use Streams

💻 Example Code

Filtering & Mapping

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);
    }
}

Reducing

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);
    }
}

🏫 Context

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.

🚀 How to Run

  1. Clone this repo
  2. Open the code in your IDE (IntelliJ, Eclipse, VS Code with Java)
  3. Compile and run each .java file

📌 Takeaways

  • Streams simplify data processing
  • Learning Streams helps prepare for technical interviews

About

CS361

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages