What is the use of interface while we can achive the same thing using abstract class. If it is useful in which senario interface come handy ? please help i think this is dumb question but i need help on this
We can't extend multiple abstract classes but we can implement multiple interfaces. So it depends on the situation/problem whether we should use abstract class or interface. Also with interface we have the option of optional operation.
interface is a good tool for managing dependencies between classes. it avoids a class depends on other class specific implementation which makes maintenance nightmare.
I can't beleive you just said that. Now I need to calm down with this tiny ad:
a bit of art, as a gift, the permaculture playing cards