Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on related to inheritance in c# within the OOPS forums, part of the Software Development category; Do you know the actual types of inheritance in C# ?...
|
|||||||
|
|||
|
Re: related to inheritance in c#
Inheritance:
C# supports two types of inheritance mechanisms 1. Implementation Inheritance 2. Interface Inheritance What is Implementation Inheritance? - When a class (type) is derived from another class (type) such that it inherits all the members of the base type it is Implementation Inheritance What is Interface Inheritance? - When a type (class or a struct) inherits only the signatures of the functions from another type it is Interface Inheritance. In general Classes can be derived from another class, hence support Implementation inheritance. At the same time Classes can also be derived from one or more interfaces. Hence they support Interface inheritance. Struts can derive from one more interface, hence support Interface Inheritance. Structs cannot be derived from another class they are always derived from System.ValueType Multiple Inheritance: 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. |
|
|||
|
Inheritance:
c# supports two types of inheritance mechanisms 1. Implementation inheritance 2. Interface inheritance what is implementation inheritance? - when a class (type) is derived from another class (type) such that it inherits all the members of the base type it is implementation inheritance what is interface inheritance? - when a type (class or a struct) inherits only the signatures of the functions from another type it is interface inheritance. In general classes can be derived from another class, hence support implementation inheritance. At the same time classes can also be derived from one or more interfaces. Hence they support interface inheritance. Struts can derive from one more interface, hence support interface inheritance. Structs cannot be derived from another class they are always derived from system.valuetype multiple inheritance: 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. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Types of Inheritance | scott | OOPS | 26 | 08-09-2009 02:01 AM |
| multiple inheritance using | amuthsen | Java | 4 | 04-07-2009 02:21 AM |
| Inheritance | pradeeban2getplaced | C and C++ | 2 | 10-11-2008 03:09 PM |
| About inheritance | rajimurugan | Java | 3 | 09-20-2007 10:01 AM |
| inheritance | sumad | C# | 4 | 06-06-2007 12:36 AM |