# Interfaces and Polymorphism

In the last chapter we discussed the pillar of **abstraction**. Creating `abstract` classes is widely recognized as one method of achieving abstraction. An `interface` is another construct/tool that help us in our goal of achieving **abstraction**. Not all object-oriented languages have an `interface` construct, but many do. While Java was not the first OOP language to use the `interface` keyword, it is the language that made it popular. In this chapter we will discuss what a Java `interface` is and how it is used. In short, an interface is like a 100% `abstract` class. Meaning, an `interface` cannot have any implementation code (method bodies) in it.

Updated: November 16, 2026

## [What is an Interface?](https://www.ask-codey.com/courses/java-full-stack-bootcamp/topics/what-is-an-interface)

1. [Interface Definition](https://www.ask-codey.com/lessons/what-is-an-interface-interface-definition) (Apprentice): The word "interface" is both a noun and a verb, and software uses both meanings.
2. [User Interfaces](https://www.ask-codey.com/lessons/what-is-an-interface-user-interfaces) (Novice): A smart home's thermostat, wall panel, phone app and voice assistant show how many user interfaces can control the same software.
3. [Software Interfaces](https://www.ask-codey.com/lessons/what-is-an-interface-software-interfaces) (Apprentice): A software interface is a contract that defines how one piece of code can interact with another.

## [Abstraction through Interfaces](https://www.ask-codey.com/courses/java-full-stack-bootcamp/topics/abstraction-through-interfaces)

1. [Solving Multiple Inheritance](https://www.ask-codey.com/lessons/abstraction-through-interfaces-solving-multiple-inheritance) (Journeyman): Java allows only one parent class, so interfaces let a class take on more than one set of abilities without the problems of multiple inheritance.

## [Defining Interfaces](https://www.ask-codey.com/courses/java-full-stack-bootcamp/topics/defining-interfaces)

1. [Defining Interfaces](https://www.ask-codey.com/lessons/defining-interfaces) (Journeyman): How to write a Java interface and implement more than one in a class with the \`implements\` keyword.

## [What is Polymorphism](https://www.ask-codey.com/courses/java-full-stack-bootcamp/topics/what-is-polymorphism)

1. [What is Polymorphism: an overview](https://www.ask-codey.com/lessons/what-is-polymorphism-an-overview) (Journeyman): Polymorphism means "many forms": one object can play many roles, like a teenager who is a student, a singer and an athlete.
2. [Changing Roles](https://www.ask-codey.com/lessons/what-is-polymorphism-changing-roles) (Journeyman): Polymorphism means focusing on just the one role of an object that matters at the moment, as Chloe is a student, a musician and an athlete at different times of day.
3. [Polymorphism with Interfaces](https://www.ask-codey.com/lessons/what-is-polymorphism-polymorphism-with-interfaces) (Freelancer): Using an interface as a variable's type lets you treat an object as just one of its roles, such as treating a Teenager as a Student or a team as a list of Athletes.

Source: https://www.ask-codey.com/courses/java-full-stack-bootcamp/chapters/interfaces-and-polymorphism
