~/ learn/ java-from-zero/ cards/ Declaring & implementing interfaces
1 of 4

Type a class implementing two interfaces

Type a class implementing two interfaces

Answer

class Duck implements Flyable, Swimmable { @Override public void fly() { } @Override public void swim() { } }

A class can implement multiple interfaces separated by commas. Every abstract method from all interfaces must be implemented, or the class must be abstract.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/e17f6566-5fd0-4dc0-a6b0-8b23459362fb/flashcard utf-8 LF