From the course: Java SE 11 Developer (1Z0-819) Cert Prep
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Lambda expression syntax variations - Java Tutorial
From the course: Java SE 11 Developer (1Z0-819) Cert Prep
Lambda expression syntax variations
- Let's investigate the syntax variations for lambda expressions. First, know that Java's lambda expressions are object expressions that must implement an interface. Lambdas are actually instances of some nameless automatically generated class, but they do differ from objects created from normal classes in that there is no this context created for the actual lambda object. The desired interface, that is the interface that our lambda should implement, must be unambiguously known from the context that the lambda expression is used in. The interface in question must always have exactly one abstract method. Although it doesn't matter whether the interface is annotated @FunctionalInterface, it must not create an error if we were to do so. Further, a lambda can only implement that one abstract method from the context interface, so there are still actually good uses for anonymous inner classes. So, let's take a look at the basic syntax of a lambda. Before we had lambdas, we might declare a…
Download courses and learn on the go
Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.
Contents
-
-
(Locked)
Module 3: Java object-oriented approach1m 21s
-
(Locked)
Learning objectives40s
-
(Locked)
Source files and basic type declarations6m 32s
-
(Locked)
Nested type declarations8m 31s
-
(Locked)
Inner class declarations, part 17m 6s
-
(Locked)
Inner class declaration, part 215m 22s
-
(Locked)
Local and anonymous class declarations9m 45s
-
(Locked)
Reachability analysis12m 59s
-
(Locked)
Question deep dive4m 14s
-
(Locked)
-
-
(Locked)
Learning objectives47s
-
(Locked)
Instance and static fields, part 18m 52s
-
(Locked)
Instance and static fields, part 212m 9s
-
(Locked)
Instance and static methods, part 18m 57s
-
(Locked)
Instance and static methods, part 211m 9s
-
(Locked)
Variable length argument handling3m 10s
-
(Locked)
Overloaded and overridden methods, part 19m 24s
-
(Locked)
Overloaded and overridden methods, part 212m 29s
-
(Locked)
Question deep dive3m 34s
-
(Locked)
-
-
(Locked)
Module 5: Working with streams and lambda expressions39s
-
(Locked)
Learning objectives45s
-
(Locked)
Lambda expression syntax variations12m 8s
-
(Locked)
Lambda expression contexts6m 5s
-
(Locked)
Core functional interfaces10m 35s
-
(Locked)
Method references12m 16s
-
(Locked)
Question deep dive4m 45s
-
(Locked)
-
-
(Locked)
Learning objectives58s
-
(Locked)
Collection and reduction, part 113m 8s
-
(Locked)
Collection and reduction, part 26m 42s
-
(Locked)
Grouping and partitioning with collectors6m 33s
-
(Locked)
Downstream operations with collectors9m 10s
-
(Locked)
Parallel stream operation7m 21s
-
(Locked)
Question deep dive3m 53s
-
(Locked)
-
-
(Locked)
Learning objectives54s
-
(Locked)
Race conditions, deadlock, and livelock12m 20s
-
(Locked)
Transactional integrity12m 32s
-
(Locked)
Visibility16m 49s
-
(Locked)
Concurrent queues and collections10m 23s
-
(Locked)
Synchronizers, locks, and atomic types, part 114m
-
(Locked)
Synchronizers, locks, and atomic types, part 215m 57s
-
(Locked)
Question deep dive1m 26s
-
(Locked)
-
-
(Locked)
Module 9: Annotations, localization, and secure coding in Java SE application1m 4s
-
(Locked)
Learning objectives36s
-
(Locked)
Annotation declaration and elements7m 6s
-
(Locked)
Target, retention, and inspection8m 49s
-
(Locked)
Element types and repeatable annotations3m 6s
-
(Locked)
Question deep dive2m 50s
-
(Locked)