Skip to content

Latest commit

 

History

History
121 lines (86 loc) · 4.08 KB

File metadata and controls

121 lines (86 loc) · 4.08 KB

Java Stream API Topics Index

This index makes it easier to discover the learning material and practice exercises included in this repository.

Start here

Core Java Stream API concepts

Available concept notes include topics such as:

  • What is a stream?
  • How to create a stream
  • Primitive streams
  • Stream vs collection
  • Intermediate vs terminal operations
  • Lazy evaluation
  • Single-use streams
  • Optional results
  • When not to use the Streams API

Open the folder: learn/concepts

Intermediate operations covered

This repository includes notes for these Java Stream API intermediate operations:

  • filter
  • map
  • flatMap
  • distinct
  • sorted
  • peek
  • limit
  • skip
  • takeWhile
  • dropWhile
  • mapMulti

Open the folder: learn/intermediate_operations

Terminal operations covered

This repository includes notes for these Java Stream API terminal operations:

  • count
  • forEach
  • forEachOrdered
  • toArray
  • min
  • max
  • anyMatch
  • allMatch
  • noneMatch
  • findFirst
  • findAny
  • reduce
  • collect

Open the folder: learn/terminal_operations

Practice exercises by difficulty

Easy Java Stream API problems

  • Numbers: count even numbers, map Celsius to Fahrenheit, remove duplicates, sort ascending or descending, calculate mean, flatten 2D arrays, and group numbers
  • Strings: count vowels, find the largest word, count character and word occurrences, concatenate strings, reverse strings with special characters, sort by the second character, find duplicate strings, and more

Open the folder: practice/a_easy_problems

Medium Java Stream API problems

  • Employee stream problems: minimum salary in each department, maximum salary in each department, employee counts, employees by department, managers with maximum employees, and employees who worked on the most projects
  • Number problems: sum of numbers, sum of unique numbers, sum of digits, reverse a number, segregate even and odd numbers, generate an infinite prime number stream, and more
  • String problems: duplicates, second highest word, first non-repeating character, unique email count, and frequent vowel-plus-consonant patterns

Open the folder: practice/b_medium_problems

Hard Java Stream API problems

  • Generate a prime number stream
  • Find the length of the largest consecutive sequence

Open the folder: practice/c_hard_problems

Functional interfaces practice

Practice tests are available for:

  • Predicate
  • Function
  • Consumer
  • Supplier
  • BiFunction
  • Comparator
  • Runnable

Open the folder: practice/functional_interfaces

Stream gatherers

The repository also includes material for Java Stream gatherers:

Suggested learning order

  1. Read the core concepts
  2. Study intermediate operations
  3. Study terminal operations
  4. Solve easy practice problems
  5. Solve medium practice problems
  6. Solve hard practice problems
  7. Review functional interfaces
  8. Explore gatherers on a supported JDK