
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Explore functional-style programming in Java with lambdas, method and constructor references, functional interfaces, and streams to write compact, efficient code. Understand the motivation and practice with realistic examples.
Explore functional-style programming in Java with lambdas and streams, learning motivation, first-class citizens, and declarative patterns for compact, parallelizable code.
Explore lambda expressions in Java, their syntax and functional interface requirements, compare with anonymous classes, and see how lambdas enable concise functional programming in Java eight.
Demonstrates implementing a simple cache of bookmarks in Java and using a lambda to sort bookmarks by title length, illustrating functional interfaces and iterators.
Explore how to use lambdas as function objects with functional interfaces in Java, contrasting with anonymous classes, and apply the strategy pattern to sort and compare bookmarks by rating.
Learn how lambdas capture variables from their enclosing scope, including local, instance, and static variables, and why local variables must be effectively final to form closures.
Explore predicate, (bi)function, and unary operator interfaces in Java, using lambda expressions to filter and transform web pages, compose functions with andThen, and leverage standard functional interfaces.
Explore the core standard functional interfaces, focusing on consumer and supplier, with examples using for each and deferred execution, and discuss primitive specializations and logging use cases.
Master Java method references and their three kinds—static methods, unbound instance methods via a class name, and bound instance methods via an object—and learn to pass methods to functional interfaces.
Discover constructor references in Java, using class name and new to instantiate objects via functional interfaces like supplier and function. Understand when to avoid consumer and how context selects constructors.
Learn how streams in Java 8 enable declarative, parallel operations on collections using lambdas and method references, with filtering, grouping, sorting, and summary operations demonstrated.
Explore the classification of Java stream operations, including intermediate and terminal types, and how a stream pipeline processes elements from a collection source.
Explore slicing a Java stream with limit, skip, and distinct in a functional style demo, merging Amazon and Barnes and Noble data to extract five books rated 4.5 or higher.
Explore the flatMap operation in Java streams, showing how map transforms orders into lists and flattening yields a single stream of items for downstream processing.
Demonstrates the flatMap operation in Java streams using orders with item lists. Contrast with map, showing how flatMap yields a sequence of individual items and uses distinct to remove duplicates.
Explore stream matching operations in Java using lambdas and streams, including anyMatch, allMatch, noneMatch, and short-circuit behavior with limit, with practical examples.
Explore finding operations in streams, using find any and find first as terminal, short‑circuit methods often paired with filter; learn how the optional class safely represents present or absent results.
Explore reduction operations in Java streams, focusing on the reduce method overloads, optional results, identity values, and associative property in parallel streams. Includes a demo with a lowest priced book.
Use reduce to compute total daily active covid cases across districts, and identify the district with the lowest and highest cases within a state, in a simple covid tracking app.
Explore special cases of reduction in Java streams: the min and max terminal operations, and the count method. These relate to the general reduced method that uses an accumulator function.
explore collection operations and mutable reduction with collect methods, using suppliers, accumulators, and combiners to build containers; contrast mutable and immutable reduction in parallel streams.
Explore java streams collect with collector. Learn how supplier, accumulator, combiner, and finisher enable mutable reductions, and use predefined collectors for joining, listing, mapping, grouping, and partitioning.
Learn how to collect stream elements into lists and sets using collectors, including toList, toSet, and toCollection, with examples of distinct filtering, suppliers, and constructor references.
Master grouping stream elements into maps with java collectors, using toMap and groupingBy, including merge strategies and tree maps, and handle duplicates across sources like Barnes and Noble and Amazon.
Explore grouping by with Java streams to build multi-level maps and summarize values using downstream collectors such as counting, averaging, minimum, and maximum. Also learn partitioning by and mapping titles.
Explore how side-effect-free, or pure, functions in Java streams rely on referential transparency, avoid mutable state, and enable safe parallel execution.
Learn functional-style Java streams and lambdas, focusing on side-effect free functions to avoid non-deterministic results in parallel streams, using a health data example with diabetic patients and average age.
Explore functional style programming in Java using lambdas and streams to write elegant, efficient code, with declarative pipelines that classify and group highly rated books by category.
Writing elegant & readable code is extremely important when building software. However, sometimes we are limited by the features of the programming language and this was the case with Java too. Code written in Java was sometimes considered verbose, which in turn made it difficult to understand. However, this started to change since Java 8 and subsequent releases. Java 8 is one of the major Java releases and it incorporated Functional-style Programming paradigm into the language by introducing constructs such as lambdas & streams. Functional programming helps us in writing code that is compact, clean and efficient.
This course will give you an in-depth understanding of Functional-style Programming in Java. All the relevant features like Lambdas, Functional Interfaces, Method & Constructor references, and Streams will be explained in great detail. You will learn how we can write compact & clean code via declarative-style programming using Streams. Every concept is clearly explained with well thought out & realistic examples, nice illustrations and demonstrated in code. Several challenging coding exercises are included to validate what you have learnt and to help you get comfortable with functional-style programming paradigm. With over 6 hours of high quality video lectures, the course is self-paced with life-time access. You get a certificate upon course completion.