
Explore how functional interfaces define a single abstract method and how lambda expressions implement them, replacing anonymous inner class syntax with concise code.
Clone the public functional programming in Java repository with git clone, install git, copy the repo URL, and import the source into IntelliJ or another IDE.
Explore lambdas with a custom generic functional interface, implement is negative using a lambda with a single abstract method, compare with the standard predicate, and understand syntax and execution timing.
Explore how the predefined Java predicate functional interface uses a test method and a lambda to return a boolean for any input type, demonstrated with integers and strings.
Explore Java functional interfaces from the API, focusing on predicate and BiPredicate. See how the test method uses generics with single and dual inputs in lambdas and string checks.
Explore the Java supplier functional interface, its get method, and how to use it with lambdas to produce values with no input, such as strings, local time, and doubles.
Explore consumer and BiConsumer interfaces, showing how accept consumes inputs with no return, including two-argument BiConsumer examples, and how forEach iterates lists and maps to print capitals.
Explore how function interfaces work in Java: the Function and BiFunction types, their apply method, and examples computing string lengths and concatenating strings.
Explore unary operator as a function where input and output types match, with string examples, and binary operator as a concise form of BiFunction using two same-type inputs.
Understand final and effectively final local variables in Java lambdas. See how a lambda captures a snapshot of a variable and requires it to remain final or effectively final.
Learn how method references can replace simple lambdas to call a single method, and explore bound and unbound styles and the compiler’s lambda transformation.
Explore bound method references in Java by binding a string instance to methods, including converting to lowercase and testing starts with a given prefix, using a supplier and a predicate.
Demonstrate unbound method references in Java by replacing lambdas with method references, illustrating how the first parameter becomes the instance and subsequent arguments pass to the method.
Learn how static method references replace lambdas, with unbound references inferred by a one-argument consumer to sort a list of integers using a static collection method.
Explore constructor method references in Java, comparing supplier and function usage to instantiate objects like string builder and array list, and harnessing the apply method to pass inputs.
Explore method references and context in Java, showing how the compiler uses surrounding context to map a method reference to supplier, function, or bi function, with lambda examples.
Explore Java eight streams and stream pipelines, including source, intermediate operations, and terminal operations. Learn how filters and predicates shape data processing and how count completes a pipeline.
Explore stream laziness and lazy evaluation, showing how streams perform operations only when a terminal operation runs, enabling efficient pipelines with map, filter, any match, and limit.
Create streams from arrays, lists, maps, and files, and explore infinite streams with generate and iterate, then use count as the terminal operation to kick off processing.
Explore terminal operations in streams, including reductions that fold all elements into one value and optional results, with non-reductions such as find any/first and all match.
The reduced terminal operation merges a stream into a single value using an identity and a binary operator (accumulator). It may return optional and supports parallel streams via a combiner.
Explore how collect uses a supplier, accumulator, and combiner to perform a mutable, mutual reduction that builds strings into a string builder, enabling parallel collection into maps, lists, and sets.
Explore Java streams collectors, using collect with toMap to map dessert names to lengths and handle duplicates with a merge function; learn key features like joining and averaging.
Explore groupingBy as a terminal collector that maps keys (via a key function) to lists of elements, with downstream collectors like toSet and tree map options for ordered keys.
Partition names into two boolean groups, a special case of grouping via Collectors.partitioningBy, then use downstream collectors to produce lists or sets in true and false groups.
Explore intermediate operations in Java streams, including filter with predicates, distinct for removing duplicates, and limit for lazy, short-circuiting execution, with peek for inspection and terminal forEach.
Explore how map and flatMap transform streams by mapping strings to integers and flattening lists, then sort with natural ordering or a comparator, filter, limit, and terminate with forEach.
Explore primitive streams in Java, including IntStream, DoubleStream, and LongStream, created from arrays or via of, with reduce and map to perform numeric operations.
Explore primitive streams in Java, focusing on max, min, and average, and note optional return types for empty streams; use summarizing statistics to derive key metrics.
Explore primitive streams and their specialized interfaces—double, long, and int variants of supplier, consumer, predicate, function, and binary operator—learning how apply and accept methods work across primitives.
Explore how primitive streams map to other streams or objects using map, including map to OBJ, map to double, and map to long targets.
Map a stream of strings to uppercase with map, then print results with for each. Convert to primitive doubles with mapToDouble using string length.
Explore mapping primitive streams to other types using mapToObj, mapToDouble, and mapToLong, with lambdas applying functional interfaces and forEach as a terminal operation to print results.
Explore Java optional as a box that may be empty, using Optional to represent missing values, including primitive optionals and methods like isPresent, get, and orElse.
Explore parallel streams in Java, showing how streams split into sub streams and process elements concurrently, with examples of parallel versus sequential streams and the order considerations.
IMPORTANT - One of my Udemy Business courses, namely, Advanced Java, Explained Simply: Java 8–25 and Spring Boot 3, contains this course as a subset. My advanced Java course contains 33h 45m of content and is worth checking out before investing in this this course (as it is, in my opinion, better value for money).
Sample reviews:
"Great course to learn about two of the most powerful Java 8 new additions, Lambdas and Streams. Thank you!" [Andrei-G C.]
"Excellent course on Java Lambdas and Streams. Doctor Sean Kennedy clearly explained all concepts and techniques using great amount of examples. The assignments reflected what we learned in the course. Thank you Doctor Sean Kennedy!" [Jing H]
"This course provides hands-on knowledge on how to work with functional programming in java. From Lambdas to Optionals, the way Java 8 api adds this new features is really a key factor to productivity and performance." [Calebe O]
"Concise, easy to follow, very useful. Very talented lecturer." [Luka K]
"Sean described lambdas and streams ,covered all the topics in detailed level." [Kalpana M]
"Very good course, learnt many new things. Dr Kennedy should bring out more courses." [Vasudha S.]
"The course is very well-organized and clearly presented. Thank you, Dr. Seán Kennedy." [Ricardo R.]
"Super course, great help with this important area of Java programming." [David F.]
"Excellent course and teacher's explanations." [E. A.]
"Fantastic course, very engaging and delivered in an easy to understand manner." [Gary W.]
"Excellent Course, the concepts are explained in a clear & concise manner making it easy to understand." [Bv]
"Content explained clearly and punctually. Recommended" [Daniel M.]
"Very good introduction, clear and easy to understand." [Richard S.]
This course is a systematic approach to explaining in both notes format and code examples, lambda expressions and streams in Java. All the code samples are included (on my GitHub repo).
Topics include:
Lambdas:
Functional Interfaces
Lambdas and their relationship to Functional Interfaces
Lambdas in code using a custom Functional Interface
Lambdas in code using the pre-defined API Functional Interfaces:
Predicate/BiPredicate
Supplier
Consumer/BiConsumer
Function/BiFunction
UnaryOperator and BinaryOperator
final and "effectively final"
Method References:
bound
unbound
static
constructor
context and it's effect in understanding method references
Assignment to reinforce the content
Streams:
Pipelines
Laziness
Creating streams
Terminal operations:
reduce()
collect()
Collectors.toMap()
Collectors.groupingBy()
Collectors.partitioningBy()
Intermediate operations:
filter(), distinct(), limit()
map(), flatMap(), sorted()
Primitive streams:
Creating
API
Functional Interfaces
Mapping between primitive streams
Mapping between primitive streams and Object streams and vice versa
Optionals
Parallel streams
Assignment to reinforce the content
This course is geared towards Java Certification i.e. the Predicate lambda sections would suit Java 8 OCA (1Z0-808). The remaining lambda sections and the streams sections would suit any version of Java OCP. This course explains the concepts through small, simple, targeted code examples.
Note that, my other 2 courses, namely "Java 8 OCA (1Z0-808) Certification - Master the Fundamentals" and "Java 21, Java 17, Java 11, Java 8 (advanced) and Spring Boot" have both been selected for the Udemy Business portfolio (only the top 3% of courses qualify).
For those who don't know me, I am a lecturer since 2002 and have taught the Java OCA and OCP syllabii since 2013 on behalf of a highly regarded software company. On completion of the courses with me, graduates then face the company's own internal Java Certification exam (similar in style to Oracle's). I have no visibility into the questions they will face. It is a 3 hour long intensive exam. The company are delighted with the pass rate (100% since year 1). I love teaching and this course has all my experience in explaining lambdas and streams in Java.