
Learn a verbose approach that groups strings by length using a hash map, with keys as string lengths and values as lists of strings of that length, including initialization.
Explore lambdas and streams through a what, how, and why approach, with practical exercises, refactoring, and guidance on the optional api and java eight concepts.
Explore how to solve list-sorting exercises in Java using anonymous classes, then replace them with lambda expressions, use the Comparator.comparing method, and apply method references.
Implement two requirements in a simple employee management system: retrieve employees by unit, first for EBC then for FSA, by filtering a preexisting list and validating results with tests.
Follow a code walkthrough in Eclipse that details the employee class with unit and designation enums and skills, then refactors methods to fetch by unit, Java skills, and senior employees.
Explore the strategy pattern by implementing filters for the EDC unit, programming skills, and senior professionals, all driven by a single get all employees filtered by method.
Understand how lambda expressions implement functional interfaces in Java, including syntax, single abstract method, and the role of the functional interface annotation.
Refactor lambda expressions to improve readability while preserving behavior, illustrating higher-order functions by passing and returning functions via functional interfaces.
Explore predicate, consumer, supplier, and function interfaces in Java, apply them in employee management refactoring, and review default methods and collection API evolution to build a foundation for lambda expressions.
Refactor Java code by replacing the employee filter with the predicate interface, using its test method for filtering, and explore combining predicates to retrieve employees by unit and skills.
Combine multiple predicates with the predicate functional interface to filter employees by Java skills and unit using lambdas and streams, and the and method.
Implement a factory using the supplier functional interface to decouple commodity creation from trading logic, enabling lazy object creation and easy extension for new commodities.
Explore the Java consumer functional interface, its accept method, and how to pass behavior as lambdas. See examples of single-parameter consumers, chaining, and a generic perform operation with lists.
Explore the Java function interface and its apply method, using lambdas to transform inputs into outputs, from string lengths and uppercase names to emails and primitive max values.
Explore how computeIfAbsent uses the function interface and lambdas to build a multi map from city data, mapping city first letters to city lists in core JDK apps.
Explore how the lambda meta factory uses invokedynamic and a bootstrap method to create runtime inner classes, distinguishing capturing from non-capturing lambdas and their synthetic methods.
Discover how lambda expressions translate at the bytecode level with dynamic instruction and invoke dynamic, and how the just-in-time compiler boosts runtime performance.
Explore how Java lambda expressions capture local variables and when they must be final or effectively final, with examples of compilation issues and the rationale to avoid race conditions.
Explore how lambda expressions offer concise, expressive, and focused code, and why they replace anonymous classes only for single-method functional interfaces, not for anonymous classes with state.
Refactor the employee sorting code by replacing anonymous comparators with lambdas, using type inference, to sort by name, then experience (ascending), and finally by name for ties.
Discover the four types of method references in Java: static methods, constructors, instance methods of arbitrary types, and instance methods of existing objects.
Refactor imperative code into a declarative stream pipeline using stream, filter, and collect to retrieve senior employees with more than 10 years of experience.
Discover where the stream method lives on lists and how a stream acts as a data pipe with no storage for processing employee objects declaratively.
Describe how the map method in the stream API transforms objects from one type to another using lambda expressions, with examples of filtering, uppercasing names, and collecting results.
Apply the map method in Java streams to transform employee objects into names by filtering a skill and collecting the results, yielding Stanley and Manoj.
Analyze how a stream pipeline processes each item in a single pass, with filter and map, without temporary data structures, as data flows top to bottom to be collected.
Use the sorted method with streams to filter employees with more than one skill, sort by experience, and return their names.
Explore using Objects.nonNull in a stream filter to safely handle an employee's null skills, avoiding null pointer exceptions and improving readability with predicates and lambdas.
Explains why methods that return a list should yield an empty list rather than null to avoid null pointer exceptions and simplify client code.
Learn to find the first matching employee in a stream using filter and findFirst, and handle the Optional class value safely without overusing get.
Learn how findFirst guarantees the first match in a stream, while findAny may return any match. The lecture demonstrates filtering by skill and handling optional results with map and orElse.
Read a 173,000-word dictionary file using Java streams to find the first word longer than 20 characters, and any word starting with the letter a and length over 10.
Explore anyMatch, allMatch, and noneMatch in Java streams, using predicates and lambdas to short-circuit a pipeline, with practical examples like recent orders and high-value transactions.
Explore how streams differ from collections: streams have no storage, are lazy and unbounded, and are functional; collections store finite elements and allow mutation.
Explore how the reduced method replaces imperative summation with declarative stream operations using a lambda or method reference, and switch to a parallel stream for parallel processing.
Explore reading a dictionary file with streams in Java, using filter, map, and reduce to find the maximum word length, and handle Optional from max.
Explore the football team domain with three classes modeling name, league (Premier League, La Liga, Bundesliga, Champions League), goals for, goals against, goal difference, and points.
Group football teams by league using an imperative approach with a hash map. Use computeIfAbsent to simplify updates and preview a collectors approach in upcoming content.
Group football teams by league and then by style of play using multilevel grouping with collectors. Refactor lambdas into a method to detect attacking or defensive style.
Join the most comprehensive course that covers Lambdas and Streams introduced in Java 8.
There are lots of exercises (along with the solution) at the end of a section that will help you gain confidence.
Using numerous real-life examples, you will learn:
What the Strategy pattern is
What kinds of problems do Anonymous classes solve?
Why do we need Lambda expressions?
How can Lambda expressions help us in writing concise code?
What are higher-order functions?
Deep dive into how Lambda expressions are implemented behind the scenes and -
Understand how to look at byte code using javap
Understand the role of the invokedynamic byte code instruction
What are Method Handles
Commonly used functional interfaces like Predicate, Function, Supplier, Consumer, BiConsumer -
How and where to apply them?
How are they used internally in the JDK library?
Function composition
Method references
Explore the Comparator interface
Numerous methods in the Stream API like - filter, map, collect, sorted, distinct
Understanding what a stream is
Understanding the important characteristics of a stream
Optional API and the right way to use them
Short-circuiting operations in the Stream pipeline
Understand why we need Primitive Streams
Reduction operations in the Stream pipeline and the importance of identity in Reduction
Explore the Collectors API
Explore flatMap and other sources of creating Streams
Explore Parallel Streams -
1. What is Moore's law?
2. Why do we need Parallel streams?
3. When should we use Parallel streams?
4. What is the infrastructure behind the scenes when we use Parallel streams?
5. How does Reduction work in parallel streams?
6. Role of the Spliterator
Learn how to debug and visualize Java 8 Streams with Eclipse & Intellij
and more!
Students completing the course will have a solid, in-depth knowledge of writing concise code using many features that have truly revolutionized how we write code in Java.
Now includes a focused PDF guide on Java 8 Lambdas & Streams — with fresh examples, best practices, and a quick reference table for coding and interviews.
What if you have questions?
I offer full support, 7 days a week, answering any questions you have.
What version of Java should you use?
I am using Java 14 for all the demos since that is the latest version when recording this course. I would urge you to use the latest version of Java. However, the focus will be on Lambdas, Streams, and lots of other features introduced in Java 8 as mentioned above.