Can an Interface Implement Another Interface?

Can an Interface Implement Another Interface?

An interface can extend other interfaces, just as a class subclass or extend another class. However, whereas a class can extend only one other class, an interface can extend any number of interfaces.

Can you implement more than one interface?

Your class can implement more than one interface, so the implements keyword is followed by a comma-separated list of the interfaces implemented by the class. By convention, the implements clause follows the extends clause, if there is one.

What happens if an interface extends another interface?

An interface may not implement any other interface. It can only extend it. The purpose of one interface extending, not implementing another, is to build a more specific interface. The compiled code will be exactly the same whether these methods are there or not.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.