Classes in Java: Implementing Functional Interfaces Using Lambdas

Java    |    Intermediate
  • 11 videos | 1h 29m 16s
  • Includes Assessment
  • Earns a Badge
Rating 4.5 of 41 users Rating 4.5 of 41 users (41)
Lambda expressions allow you to define classes that implement single-method interfaces in a very concise and compact manner. This makes code that uses lambda functions easier to read and understand and much more maintainable. Lambda expressions can be made even more compact and readable by the use of method references. In this course, you will learn to create and use lambda expressions to implement functional interfaces. You will see that lambda expressions are essentially blocks of code that accept input arguments, perform operations, and return values. Lambda expressions can be used in any place where we use anonymous classes or a named class that implements an interface with just a single abstract method. You will see that lambdas can only be used to implement functional interfaces i.e. interfaces that have exactly one abstract method. Such interfaces are usually annotated using the @FunctionalInterface annotation which allows the compiler to detect if the single abstract method contract has been violated for such interfaces. You will understand and implement the four types or categories of functional interfaces, the Predicate, Function, Consumer, and Supplier interfaces. Finally, you will round this course off by exploring and implement method references which are essentially even more compact representations of lambda expressions. When you are finished with this course you will have the skills and knowledge to construct lambda expressions in the right way and use Predicates, Functions, Suppliers, and Consumers to process and store your objects.

WHAT YOU WILL LEARN

  • Discover the key concepts covered in this course
    Define and use lambda expressions
    Compare and contrast lambda statements and expressions
    Recall how lambdas can only implement functional interfaces
    Implement interfaces with generic types using lambdas
    Mark functional interfaces with @functionalinterface annotation
  • Recall how functional interface instances are objects
    Create predicate, consumer, function, and supplier interfaces
    Invoke static and instance methods using method references
    Invoke instance methods with types and invoke constructors using method references
    Summarize the key concepts covered in this course

IN THIS COURSE

  • 2m 21s
  • 8m 30s
  • Locked
    3.  Creating Lambda Statements and Lambda Expressions
    13m 17s
  • Locked
    4.  Implementing Functional Interfaces Using Lambdas
    7m 45s
  • Locked
    5.  Implementing Generic Interfaces Using Lambdas
    11m 38s
  • Locked
    6.  Using the @FunctionalInterface Annotation
    5m 5s
  • Locked
    7.  Exploring Nuances of Functional Interfaces
    7m 2s
  • Locked
    8.  Predicate, Consumer, Function, and Supplier
    13m 29s
  • Locked
    9.  Method References: Static and Instance Methods
    7m 56s
  • Locked
    10.  Method References: Type Methods and Constructors
    10m 13s
  • Locked
    11.  Course Summary
    1m 59s

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.

YOU MIGHT ALSO LIKE

Rating 4.3 of 63 users Rating 4.3 of 63 users (63)
Rating 4.7 of 13 users Rating 4.7 of 13 users (13)
Rating 3.4 of 7 users Rating 3.4 of 7 users (7)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.3 of 48 users Rating 4.3 of 48 users (48)
Rating 4.6 of 144 users Rating 4.6 of 144 users (144)
Rating 4.5 of 36 users Rating 4.5 of 36 users (36)