Java Learner logo

Module 7: Advanced Object-Oriented Concepts

Lesson focus

Multiple Inheritance Through Interfaces

Resolve conflicting defaults, compose behaviors, and document intent when a class implements several interfaces.

When two interfaces define the same default method, the implementing class must override it explicitly and choose which behavior to use.

Interfaces describing orthogonal capabilities (e.g., Auditable, Versioned) create flexible components without rigid hierarchies.

Use marker interfaces (like Serializable) sparingly; prefer annotations when possible.

Lesson quiz

How do you resolve conflicting default methods from two interfaces?

Next lesson →