Core Java

Interfaces, Lambda Expressions, and Inner Classes

Copyright © Cay S. Horstmann 2016

Understand the concept of interfaces

The Interface Concept

Implementing an Interface

Making Use of an Interface

interfaces

Understand the properties of Java interfaces

Properties of Interfaces

Properties of Interfaces

Interfaces and Abstract Classes

Static Methods in Interfaces

Work with default methods

Default Methods in Interfaces

Interface Evolution

Resolving Default Method Conflicts

The “Interfaces Clash” Rule

The “Superclasses Win” Rule

Become familiar with use cases for interfaces

Callbacks

timer

Comparators

Cloning

Shallow Copies

Deep Copies

clone

Understand how lambda expressions work

Why Lambdas?

The Syntax of Lambda Expressions

Functional Interfaces

lambda

Generic Functional Interfaces

Method References

Constructor References

Variable Scope

Effectively Final Variables

Processing Lambda Expressions

More about Comparators

Understand the inner workings of inner classes

Inner Classes

Inner and Outer Classes

innerClass

Inner Class Syntax

Local Inner Classes

Anonymous Inner Classes

anonymousInnerClass

Static Inner Classes

  • Called as:
    ArrayAlg.Pair p = ArrayAlg.minmax(data);
  • staticInnerClass