Implementing Multiple Interfaces in Java
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.
Comma-separated implements
class Duck implements Flyable, Swimmable takes on both interfaces' obligations in one declaration.
Every abstract method from every interface must be implemented
Regardless of how many interfaces are listed.
No field-based ambiguity
Since interfaces traditionally carry no instance state, there's nothing like conflicting inherited fields to resolve.
A genuine conflict case
Two interfaces with a default method of the exact same signature require the implementing class to override it explicitly.
A class can still extend one class and implement several interfaces
The class-inheritance limit and the multi-interface allowance are entirely separate rules.
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(); }}Recommended resourcesAffiliate links · may earn us a commission
Recommended for learners
Practice what you learned
Re-implement each visualized algorithm in Java yourself — building beats watching.