Core Java

Interfaces, Lambda Expressions, and Inner Classes

Slide navigation: Forward with space bar, → arrow key, or PgDn. Backwards with ← or PgUp.

.jpg

Copyright © Cay S. Horstmann 2016

Except where otherwise noted, this work is licensed under .svg

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

Java 9 News Flash - Private Interface Methods

.png

Become familiar with use cases for interfaces

Callbacks

timer

Comparators

Cloning

.gif

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

.gif

innerClass

Inner Class Syntax

Local Inner Classes

Anonymous Inner Classes

anonymousInnerClass

Static Inner Classes

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