Learn Java
import com.learnjava.oopadvanced.MultipleInterfaceImplementation;

Implementing Multiple Interfaces in Java

@Concept

A single class can implement any number of interfaces at once, listed comma-separated after implements — class Duck implements Flyable, Swimmable takes on the obligations of both, and must supply a concrete implementation for every abstract method either interface declares. This is how Java approximates multiple inheritance's flexibility without its classic ambiguity problems, since interfaces traditionally carry no state — there's no possibility of two interfaces each contributing a conflicting field the way multiple superclasses' fields might collide.

If two implemented interfaces happen to declare a default method with the exact same signature, Java requires the implementing class to explicitly override that method itself, resolving the ambiguity by hand rather than silently picking one interface's version over the other.

@HowItWorks
1

Comma-separated implements

class Duck implements Flyable, Swimmable takes on both interfaces' obligations in one declaration.

2

Every abstract method from every interface must be implemented

Regardless of how many interfaces are listed.

3

No field-based ambiguity

Since interfaces traditionally carry no instance state, there's nothing like conflicting inherited fields to resolve.

4

A genuine conflict case

Two interfaces with a default method of the exact same signature require the implementing class to override it explicitly.

5

A class can still extend one class and implement several interfaces

The class-inheritance limit and the multi-interface allowance are entirely separate rules.

@Example
interface Flyable {
void fly();
}
 
interface Swimmable {
void swim();
}
 
public class Duck implements Flyable, Swimmable {
public void fly() {
System.out.println("Flying low over the pond");
}
 
public void swim() {
System.out.println("Paddling across the pond");
}
 
public static void main(String[] args) {
Duck d = new Duck();
d.fly();
d.swim();
}
}
Output
Flying low over the pond
Paddling across the pond
1Duck implements two separate interfaces at once, taking on both of their method obligations.
2fly() satisfies Flyable's requirement, with its own complete implementation.
3swim() satisfies Swimmable's separate requirement, entirely independently of fly().
4Both println calls run once each, one from each implemented method, giving two lines total.
@UseCases
Giving a class multiple, genuinely unrelated capabilities, like being both Flyable and Swimmable
Combining several small, focused interfaces instead of one large one a class might not fully need
Resolving a naming conflict explicitly when two implemented interfaces share a default method signature
Designing interfaces around single, narrow capabilities that can be mixed and matched freely

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Classic DSA interview booksThe reference books interviewers themselves learned from — great next to the visualizers.See the books

Practice what you learned

Re-implement each visualized algorithm in Java yourself — building beats watching.