h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Define Types of Inheritance

1) Single Inheritance
  This is the simplest type of inheritance.
  An inheritance relationship, with only one super class and one sub class.
2) Hierarchical Inheritance
 An inheritance relationship, with only one super class and multiple sub classes.
3) Multi-Level Inheritance
  An inheritance relationship, with only one super class and multiple sub classes, and also extended with another sub class from the first sub class.
  In other words, one class acts as super class and sub class simultaneously.
4) Multiple Inheritance
  An inheritance relationship,with only multiple super classes and only one sub class.
  Multiple Implementation Inheritance is not supported by C#, but Multiple Interface Inheritance is supported by C#.
5) Hybrid Inheritance
   An inheritance relationship that contains a combination of any other two types of inheritances.

Define Classification of Inheritance supported by C#:

1) Implementation Inheritance:

  •  This is commonly used inheritance.
  •  Whenever a class is derived from another class, it can be called as ―Implementation Inheritance.
  •  As said above, all of the members of the super class are adopted by sub class.

2) Interface Inheritance:

  •  This type of inheritance is taken from ―Java.
  •  Whenever a class is derived from an interface, it can be called as ―Interface Inheritance.
  •  The interface is similar to the class, but doesn‘t contain the method definitions; it contains the method declarations only. We discuss about the interfaces in-depth later.