Hmm, I still don't get what the difference between abstract and interface is. Sure, abstract classes must have at least 1 abstract method and an interface must have NO implemented methods, but what's the use? Why not only use abstract and forget about interfaces?
Hi the reason why we go for interface is, in C#, we dont have multiple inheritance. It means, a class can inherit from only one base class. So in order to support multiple inheritance, we go for interface.
And also the difference between the two is, in abstract class not all the methods need to be abstract(ie) some methods may have implementation in base class itself
Hmm, I still don't get what the difference between abstract and interface is. Sure, abstract classes must have at least 1 abstract method and an interface must have NO implemented methods, but what's the use? Why not only use abstract and forget about interfaces?
Time4TruthDOTorg 5 months ago
@Time4TruthDOTorg
Hi the reason why we go for interface is, in C#, we dont have multiple inheritance. It means, a class can inherit from only one base class. So in order to support multiple inheritance, we go for interface.
And also the difference between the two is, in abstract class not all the methods need to be abstract(ie) some methods may have implementation in base class itself
treskarthik 2 months ago