Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can an interface extend a class?

class EXTEND interface
0
Posted

Can an interface extend a class?

0

In Java an interface can only extend another interface, called a super-interface. This is an inheritance relationship like superclass-subclass; the sub-interface inherits all the constant variables and abstract methods defined in the super-interface and can add its own. Since an interface may have a static class defined within it, it is possible for a class in a sub-interface to extend a class in a super-interface, but that is a different thing entirely. In this case the extension of nested classes is no different from standard extends inheritance except the hosts of the classes are interfaces. There is no mixture of class and interface extension. Actions: Follow-up or correct this answer. Submit a new question.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123