Wednesday 12 March 2014

Types of Inheritance

What are the different categories of inheritance?

  • Single inheritance : Contains one base class and one derived class.
  • Hierarchical inheritance : Contains one base class and multiple derived classes of the same base class.
  • Multilevel inheritance : Contains a class derived from a derived class.
  • Multiple inheritance : Contains several base classes and a derived class.
  • Hybrid inheritance : is nothing but a any combination of single,multiple and inheritance inheritance. Multiple inheritance class is not possible as it give assembly level error when we use the same name for method. Multiple inheritance in interface is possible.

No comments:

Post a Comment