Why do we need an interface when we have an abstract class?

Possible duplicate:
Need for an abstract class as well as an interface?

Why do we need an interface when we have an abstract class?

Answer: The only goal for an interface is to achieve multiple inheritance

Correct me if I'm wrong

+3


source to share


2 answers


Thanks for using over the sequel.



Implementing an interface is more flexible than extending an abstract class. You can only extend one class, but you can implement many interfaces.

+2


source


There are many similar questions here. SO.

Why programming for abstract classes instead of wrong interfaces?



I answered here about the pros and cons of each, you can check it out.

+1


source







All Articles