Core Java Advanced LiveLessons

Java 8 Interfaces and Lambda Expressions

Copyright © Cay S. Horstmann 2016

Recall the concept of interfaces

The Interface Concept

Implementing an Interface

Making Use of an Interface

lesson01/interfaces

Add logging to show invocation

Understand Java 8 features of interfaces

Static Methods in Interfaces

Default Methods in Interfaces

Interface Evolution

Resolving Default Method Conflicts

Recall how interfaces are used for callbacks

Callbacks

lesson01/interfaces

Understand how lambda expressions work

Why Lambdas?

The Syntax of Lambda Expressions

Functional Interfaces

lesson01/interfaces

Generic Functional Interfaces

Method References

Constructor References

Variable Scope

Effectively Final Variables

Processing Lambda Expressions

More about Comparators

lesson01/interfaces

Comparator.comparingDouble(Employee::getSalary)
    .thenComparing(Employee::getName));