Difference b/w multiple inheritance and Interface

Posted by Kalaikathiravan under DotNetFunda.Com on 11/5/2012 | Points: 10 | Views : 1229 | Status : [Member] | Replies : 1
What is the Difference between Multiple inheritance and interface Please tell me


Posted by: Rajesh081725 on: 11/5/2012 [Member] Bronze | Points: 25

Interface is a contract that defines the signature of the functionality. So if a class is implementing a interface it says to the outer world, that it provides specific behavior. Example if a class is Interface Read More..

Interface support multiple inheritance
Interface does'n contains Cunstructors
An interface Contains only incomplete member (signature of member)
An interface cannot have access modifiers by default everything is assumed as public
Member of interface can not be Static
Class inheritance represents an "is-a" relationship, e.g., a Tank is a Vehicle. If your situation doesn't at least meet this, choose interface over inheritance.

In C#, you can only inherit from one class but multiple interfaces. This would be yet another reason to choose interface over inheritance.



Time is Gold
Thanks & Regards,
Rajesh Kumar,

Kalaikathiravan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response