# Java Level 3: Interfaces & Polymorphism

> Level 3: Interfaces & Polymorphism of the LoWisa Java course: Interfaces and Abstract Classes, Dynamic Dispatch, Designing Flexible Object Models. 3 lessons and 9 ideas, each explained in one line.

Interfaces & Polymorphism is level 3 of 16 of the [LoWisa Java course](/courses/java/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Interfaces and Abstract Classes

- **Interfaces.** An **interface** declares capability without implementation: Payable says what, classes say how.
- **implements.** A class **implements** an interface and must supply every method: the compiler enforces the contract.
- **Abstract classes.** An **abstract** class mixes implemented behaviour with holes subclasses must fill: half library, half contract.

## Dynamic Dispatch

- **Polymorphism.** **Polymorphism** lets one variable of an interface type hold any implementation: code written to the contract.
- **Dynamic dispatch.** A call on an interface reference resolves at **runtime** to the actual object’s method: dynamic dispatch.
- **Program to interfaces.** Declaring List instead of ArrayList keeps callers **decoupled**: the implementation swaps without a ripple.

## Designing Flexible Object Models

- **Small interfaces.** Small, focused **interfaces** compose: a class can be Comparable and Closeable without a tangled hierarchy.
- **Sealed hierarchies.** A **sealed** class names its permitted subclasses: the compiler then knows every case that can exist.
- **Design by contract.** Good models document what callers may **assume**: preconditions and guarantees written at the interface.

## Before and after this level

- **Before:** [Level 2: Classes & Objects](/courses/java/level-2-classes-and-objects/): Classes and Instances, Encapsulation and Constructors, Composition and Inheritance.
- **Next:** [Level 4: Collections & Generics](/courses/java/level-4-collections-and-generics/): Lists, Sets and Maps, Generic Types, Choosing Appropriate Collections.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does Java Level 3: Interfaces & Polymorphism cover?

Interfaces and Abstract Classes, Dynamic Dispatch, Designing Flexible Object Models: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 2: Classes & Objects, which covers Classes and Instances, Encapsulation and Constructors, Composition and Inheritance.

## Learn Java on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/java/level-3-interfaces-and-polymorphism/ · Updated 2026-11-16
