Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Interface Inheritance

Yes, an interface can extend another interface. Just say that it does, like this:

public interface ISpy extends
IInternationalManOfMystery {... }

This is rarely used in practice. It means just what you would expect: Now the class that implements ISpy must also implement all of the methods from IInternationalManOfMystery.

Also, an interface is allowed to extend more than one interface. Just separate them by commas. Notice that this is different than regular classes, which are not allowed to extend more than one class.

  • + Share This
  • 🔖 Save To Your Account