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.

Why use interfaces instead of abstract classes?

abstract classes interfaces
0
Posted

Why use interfaces instead of abstract classes?

0

The key difference between abstract class and interface based inheritance is that concrete classes are bound to a single abstract class hierarchy, they are tightly coupled and cannot extend any other class. This makes it difficult to create general purpose component classes that can be re-used in different packages. Interface based inheritance does not create a binding to a specific class hierarchy, so concrete classes can inherit the type characteristics of several interfaces without limiting their scope for re-use. Concrete classes can implement multiple interfaces and extend an abstract class, but it is best to minimise class inheritance as far as possible to preserve lexibility. 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