Java Streams and Lambda Expressions Tutorial explores the newest additions to Java 8. The tutorial contains practical examples of how to use Stream API, Lambdas, and method refereneces to solve common problems.
Java 8 fundamentals
- Static and default methods in Java 8 interfaces
How addition of static and default methods to interfaces in Java 8 simplifies functional programming. - Java 8 Functional Interfaces
What are functional interfaces and how @FunctionalInterface helps.
Stream functions
- Building Streams
Find out how to create Streams in common and not so common ways. - flatMap in action
How to use Stream.flatMap() to simplify processing of tree-like structures! - Reduce by example
All Java 8 Stream.reduce() methods explained on examples!
Collectors
- Java 8 List to Map
How to create a map from list of elements using Java 8 Streams and Collectors. - Java 8 count frequency of elements/chars/numbers/objects
How to count frequencies with help of Collectors.toMap(). - Java 8 count frequency of chars in String
How to count frequencies of chars in String using two different Java 8 features.
IntStream – stream of primitive integers
- Java 8 range of numbers
How to use IntStream to generate range of numbers. - Java random integers in range
Simple ways to generate random integers using IntStream and Random.