Prepare for your Next Interview
This is a discussion on Inhertinace within the C# forums, part of the Software Development category; how many types of inheritance posible in c# using .net....
|
|||
|
how many types of inheritance posible in c# using .net.
|
| The Following 3 Users Say Thank You to abhi.raj4u For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: Inhertinace
No only 3 types of inheritance are possible as far as C# is concerned
1. Single 2.Multi level 3. Hierarchical |
|
|||
|
Re: Inhertinace
C# support two types of inheritance.
1.Implementation Inheritance 2.Interface Inheritance. Implementation Inheritance: If a class is derived frm another class such that it inherits all the members of base class then it is implementation inheritance. Interface Inheritance: when a class inherits only signatures of functions frm another calss then it's known as interface inheritance...... |
|
|||
|
Quote:
|
|
|||
|
Re: Inhertinace
There are two types of inheritance used in modern programming languages. C# and other .NET languages use single inheritance. This means that a subclass may only inherit functionality from a single base class.
Multiple inheritance permits a subclass to have two or more superclasses. In this situation the derived class inherits functionality from several base classes. Multiple inheritance is not supported by C# or the .NET framework. However, this does not stop a class from providing many public interfaces as will be seen in a later article. PLease let me know if i am wrong or missing something |
|
|||
|
Re: Inhertinace
C# does not support multiple implementation inheritance. A class cannot be derived from more than one class. However, a class can be derived from multiple interfaces.
|