Wednesday, 6 April 2016

Explain different types of inheritance.

Inheritance in OOP is of four types:


  1. Single inheritance - Contains one base class and one derived class
  2. Hierarchical inheritance - Contains one base class and multiple derived classes of the same base class
  3. Multilevel inheritance - Contains a class derived from a derived class 
  4. Multiple inheritance - Contains several base classes and a derived class 

All .NET languages supports single, hierarchical, and multilevel inheritance. They do not support multiple inheritance because in these languages, a derived class cannot have more than one base class. However, you can implement multiple inheritance in.NET through interfaces.

No comments:

Post a Comment

Featured post

What is SharePoint?

Microsoft SharePoint is an extensible platform that provides a range of products that can help organizations with solution for a variety...