Udemy
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Development
Web Development Data Science Mobile Development Programming Languages Game Development Database Design & Development Software Testing Software Engineering Development Tools No-Code Development
Business
Entrepreneurship Communications Management Sales Business Strategy Operations Project Management Business Law Business Analytics & Intelligence Human Resources Industry E-Commerce Media Real Estate Other Business
Finance & Accounting
Accounting & Bookkeeping Compliance Cryptocurrency & Blockchain Economics Finance Finance Cert & Exam Prep Financial Modeling & Analysis Investing & Trading Money Management Tools Taxes Other Finance & Accounting
IT & Software
IT Certification Network & Security Hardware Operating Systems Other IT & Software
Office Productivity
Microsoft Apple Google SAP Oracle Other Office Productivity
Personal Development
Personal Transformation Personal Productivity Leadership Career Development Parenting & Relationships Happiness Esoteric Practices Religion & Spirituality Personal Brand Building Creativity Influence Self Esteem & Confidence Stress Management Memory & Study Skills Motivation Other Personal Development
Design
Web Design Graphic Design & Illustration Design Tools User Experience Design Game Design Design Thinking 3D & Animation Fashion Design Architectural Design Interior Design Other Design
Marketing
Digital Marketing Search Engine Optimization Social Media Marketing Branding Marketing Fundamentals Marketing Analytics & Automation Public Relations Advertising Video & Mobile Marketing Content Marketing Growth Hacking Affiliate Marketing Product Marketing Other Marketing
Lifestyle
Arts & Crafts Beauty & Makeup Esoteric Practices Food & Beverage Gaming Home Improvement Pet Care & Training Travel Other Lifestyle
Photography & Video
Digital Photography Photography Portrait Photography Photography Tools Commercial Photography Video Design Other Photography & Video
Health & Fitness
Fitness General Health Sports Nutrition Yoga Mental Health Dieting Self Defense Safety & First Aid Dance Meditation Other Health & Fitness
Music
Instruments Music Production Music Fundamentals Vocal Music Techniques Music Software Other Music
Teaching & Academics
Engineering Humanities Math Science Online Education Social Science Language Teacher Training Test Prep Other Teaching & Academics
AWS Certification Microsoft Certification AWS Certified Solutions Architect - Associate AWS Certified Cloud Practitioner CompTIA A+ Cisco CCNA Amazon AWS CompTIA Security+ AWS Certified Developer - Associate
Graphic Design Photoshop Adobe Illustrator Drawing Digital Painting InDesign Character Design Canva Figure Drawing
Life Coach Training Neuro-Linguistic Programming Personal Development Mindfulness Meditation Personal Transformation Life Purpose Emotional Intelligence Neuroscience
Web Development JavaScript React CSS Angular PHP WordPress Node.Js Python
Google Flutter Android Development iOS Development Swift React Native Dart Programming Language Mobile Development Kotlin SwiftUI
Digital Marketing Google Ads (Adwords) Social Media Marketing Google Ads (AdWords) Certification Marketing Strategy Internet Marketing YouTube Marketing Email Marketing Retargeting
SQL Microsoft Power BI Tableau Business Analysis Business Intelligence MySQL Data Analysis Data Modeling Big Data
Business Fundamentals Entrepreneurship Fundamentals Business Strategy Online Business Business Plan Startup Blogging Freelancing Home Business
Unity Game Development Fundamentals Unreal Engine C# 3D Game Development C++ 2D Game Development Unreal Engine Blueprints Blender
2021-01-28 11:29:21
30-Day Money-Back Guarantee
IT & Software Other IT & Software Lambda Expressions

Lambdas in Java - From Zero to Hero

Master Lambda expressions and the Stream API in Java
Hot & New
Rating: 4.8 out of 54.8 (7 ratings)
118 students
Created by Ajay Iyengar
Last updated 1/2021
English
English [Auto]
30-Day Money-Back Guarantee

What you'll learn

  • Starting from the basics, gain in-depth knowledge about Lambdas and Streams using lots of examples
  • Explore a variety of functional interfaces
  • Understand how Lambda expressions are implemented in the JDK by looking at the byte code
  • Complete understanding of Method references, Optional API, Comparator
  • Explore numerous methods in the Stream API and the Collectors class
  • Understand Reduction, flatMap, Parallel Streams, and when to use them
  • Learn "good" coding practices as we discover these topics by a professional Java developer who has been working with the language for 14 years
  • With plenty of exercises to solve, confidently demonstrate your understanding of Lambdas and Streams to future employers

Requirements

  • Some (intermediate level) programming experience with Java
  • A computer with the latest JDK and an IDE
  • You need not have any experience with Lambdas and Streams
  • Desire to learn while still enjoying a few jokes!

Description

Join the most comprehensive course that covers Lambdas and Streams in Java.

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 -

    1. Understand how to look at byte code using javap

    2. Understand the role of the invokedynamic byte code instruction

    3. What are Method Handles

  • Commonly used functional interfaces like Predicate, Function, Supplier, Consumer, BiConsumer  -

    1. How and where to apply them?

    2. 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

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.

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?

At the time of creating this course, I am using Java 14 for all the demos and I would urge you to use the latest version of Java. The focus will however be on Lambdas, Streams, and all the features mentioned above.

Who this course is for:

  • This course is for Java developers who want to get a solid understanding of Lambdas and Streams

Course content

13 sections • 163 lectures • 18h 10m total length

  • Preview03:25
  • Preview07:43
  • Preview03:19
  • Preview05:38
  • Preview04:03
  • Preview01:32
  • Preview08:24
  • Preview04:02
  • Downloading the code
    01:40

  • Preview03:05
  • Tackling requirements in a simple Employee Management System and solving them
    06:21
  • Code refactoring - Improving on the first solution
    04:49
  • Copy Pasting solutions - Tackling a couple of more requirements
    08:05
  • Code walkthrough of the solutions so far
    08:17
  • Introduction to the Strategy pattern
    03:22
  • Understanding the Strategy pattern
    07:31
  • Code walkthrough - Implementing the Strategy pattern
    08:51
  • Introduction to anonymous classes
    04:22
  • Code refactoring - Replacing the Strategy pattern with anonymous classes
    08:34
  • Exercise one - Simulate a simple payment process for a shopping cart
    00:54
  • Exercise two - Payment process for a shopping cart using the Strategy pattern
    00:35

  • Preview01:28
  • Writing our first Lambda expression
    03:50
  • Understanding Lambda expressions
    09:45
  • Understanding the relation between lambda expressions and a functional interface
    07:22
  • Code refactoring - Replacing an anonymous class with a lambda expression
    08:35
  • Code refactoring - Understanding the concept of higher-order functions
    09:19
  • Replacing multiple lines of code by using the extract method technique
    03:15
  • Exercise - Lambda expressions
    01:02

  • Preview02:14
  • Introduction to the Predicate functional interface
    01:57
  • Code refactoring - Applying the Predicate interface
    06:12
  • Code - Combining multiple predicates with the Predicate functional interface
    07:04
  • Exploring default methods
    11:37
  • Exploring the removeIf method, a default method
    11:18
  • Introduction to the Supplier functional interface
    14:59
  • Code - Implementing the factory pattern using the Supplier functional interface
    10:47
  • Code - Understanding ThreadLocal and the Supplier functional interface
    15:43
  • Understanding how Java Logging API utilizes Supplier functional interface
    04:02
  • Introduction to the Consumer functional interface
    02:10
  • Code - Exploring the Consumer functional interface
    14:27
  • Code - Understanding the 'andThen' method in the Consumer functional interface
    06:51
  • The 'forEach' method and the Consumer functional interface
    03:54
  • Code - Understanding how the BiConsumer functional interface is used in the JDK
    11:48
  • Code - Introduction to the functional interface, Function
    13:20
  • Code - Exploring the 'andThen' method in the Function interface.
    08:45
  • Code - Difference between 'andThen' and 'compose' method in Function interface
    07:53
  • Code - Applying 'Predicate' and 'Function' together
    17:27
  • Code - Understanding the 'computeIfAbsent' method
    16:01
  • Summary of Functional interfaces
    09:02
  • Exercise - Functional Interface
    00:42

  • Preview01:41
  • Peek at the byte code, challenges of running a dynamically typed language on JVM
    15:50
  • What is invokedynamic and what problem did it solve?
    06:52
  • Laying the groundwork - Understanding MethodHandles
    07:19
  • Putting it all together - Lambda expressions, MethodHandles, and invokedynamic
    17:18
  • Deep dive into LambdaMetaFactory, capturing, and non-capturing Lambdas.
    11:09
  • Translation of Lambda expressions and performance
    03:07

  • Preview03:13
  • Understanding the concept of "Effectively final"
    10:16
  • Understanding lexical scope in Lambda expressions
    11:39
  • Finding an answer to the question - "Do Lambdas replace anonymous classes?"
    02:14
  • Code - Sorting employee objects using an anonymous class
    12:11
  • Code - Refactoring : Replacing the anonymous class with lambda expressions
    04:46
  • Code - Refactoring : Using the sort method from the List interface
    03:53
  • Code - Understanding comparing, thenComparing, and reversed from Comparator
    13:57
  • Code - Final Refactoring, using comparingInt method from Comparator
    07:30
  • Understanding Method references
    14:11
  • Code - Refactoring sorting methods to use method references
    12:58
  • Exercise 1 - Sorting a list of strings using Comparator
    00:13
  • Exercise 2 - Sorting a list of PremierLeagueTeam objects
    00:57

  • Preview02:40
  • Introduction to stream, filter, and collect methods
    07:04
  • Code - Applying stream, filter, and collect using an example
    06:15
  • Understand what a stream is and where does this stream live
    04:31
  • Introduction to the 'map' method in the Stream API
    05:12
  • Code - Applying the 'map' method in an example
    04:55
  • Understanding the lazy nature of Streams
    07:06
  • Understanding data flow in a Stream pipeline
    08:43
  • Introduction to the sorted method in the Stream API
    06:08
  • Code - Applying 'sorted' functionality in an example
    08:21
  • A look at the nonNull method in the Objects class
    04:16
  • Introduction to the distinct method in the Stream API
    07:20
  • Code - Applying the 'distinct' method in an example
    06:59
  • Stateful vs. Stateless operations in a Stream pipeline
    06:13
  • Peeking into the sorted and distinct operations in the Stream pipeline
    15:55
  • Exercise - Perform basic Stream API operations around a mock movie database.
    01:01

  • Preview03:29
  • Follow good coding practices - Return an empty list and not a null from a method
    05:08
  • Introduction to the Optional API
    07:07
  • Exploring the commonly used methods in the Optional class
    06:19
  • Understanding the design intention behind the Optional class
    07:49
  • Finding the first element of a stream and applying the Optional class
    07:35
  • Introduction to the 'map' and 'orElse' method in the Optional class
    10:51
  • Introduction to the orElse family of functions in the Optional class
    08:37
  • Introduction to the findAny method in the Optional class
    03:53
  • Code - Reading a file with lots of words and applying the findFirst and findAny
    08:49
  • A look at the anyMatch, allMatch, and noneMatch methods in the Stream API
    08:04
  • Introduction to the short-circuiting methods - limit and takeWhile
    10:13
  • Recommendations - Using the Optional class
    09:10
  • Understanding encounter order in a Stream pipeline
    09:41
  • Differences between Streams and Collections
    04:56
  • Exercise - Search Methods in the Stream API
    01:36

  • Preview04:18
  • Understanding the concept of Reduction
    04:30
  • Why do we need a reduction and the importance of an identity in a reduction
    11:40
  • First glimpse of a parallel stream
    07:15
  • More examples of a reduce method
    06:13
  • Introduction to primitive specializations of streams
    09:21
  • Finding the sum of the elements in the Stream using the sum method
    03:33
  • Finding the count of elements in a Stream using the count method
    06:47
  • Finding the minimum and maximum element in a Stream using the min and max method
    08:25
  • Mutable reduction using the 'collect' method
    06:13
  • Code - Reading a file with a lot of words and applying the max method
    08:35
  • Code - Reading a file with a lot of words and applying the max and min method
    06:35
  • Code - Reading a file and applying the sum and count methods
    05:23
  • Exercise - Reduction operations
    00:31

  • Preview05:34
  • Preview05:18
  • Preview05:16
  • Grouping objects using an imperative style of coding
    09:18
  • Grouping objects using the declarative style of coding
    07:33
  • Collecting the number of input elements in a downstream collector
    05:28
  • Finding the sum using a mapper function in a downstream collector
    08:04
  • Partitioning the input elements of a stream
    04:16
  • Code - Applying the groupingBy method
    07:27
  • Code - Example of a multilevel groupingBy
    06:27
  • Code - Finding statistics in a single pass using IntSummaryStatistics
    07:06
  • Joining the elements of a stream using a collector
    04:51
  • Code - Mapping function in a downstream collector
    09:06
  • Code - How to partition and then group objects?
    05:08
  • Exercise - Using the Collectors class
    00:47

Instructor

Ajay Iyengar
Developer |Passionate teacher |Architect | Blogger
Ajay Iyengar
  • 4.8 Instructor Rating
  • 7 Reviews
  • 118 Students
  • 1 Course

I am a software architect on paper but a developer at heart.

After working as a software developer, technical lead, and architect for 14 years in the Java ecosystem for various companies, I decided to follow my calling, which is to teach. Even when I was working, using my hands-on experience as a software developer, I have delivered lectures on C++, Java, Spring framework, and Design patterns.

I am also a blogger where I write about Java, Spring, Hibernate, and Data structures.

I love playing and watching football.

Data is all around us, but knowledge is not - whether it was my graduation or in my job, many a time, I had to learn technical concepts the hard way. I am here to make it easy for you.

See you in the course...

  • Udemy for Business
  • Teach on Udemy
  • Get the app
  • About us
  • Contact us
  • Careers
  • Blog
  • Help and Support
  • Affiliate
  • Terms
  • Privacy policy
  • Cookie settings
  • Sitemap
  • Featured courses
Udemy
© 2021 Udemy, Inc.