Home > DeveloperSection > Beginner > Introduction to inheritance

Introduction to inheritance


C# C#  .NET  OOPS 
Ratings:
0 Comment(s)
 2708  View(s)
Rate this:

Inheritence in C#: 


Inheritance is the ability to create a class from another class, the "parent" class, extending the functionality and state of the parent in the derived, or "child" class. It allows derived classes to overload methods from their parent class.

Inheritance is one of the pillars of object-orientation. It is the mechanism of designing one class from another and is one of the ideas for code re usability, supporting the concept of hierarchical classification. C# programs consist of classes, where new classes can either be created from scratch or by using some or all properties of an existing class.

 

Every programming languages that supports OOP must contains a provision for implementing Inheritance. And each language has its own syntax to create and use it.

Inheritance is the basic concept of OOPs (object oriented programming). The main advantage of inheritance is provide code re-usability.

Inheritance implement by inheriting the base (super/parent)class  member to its derived (sub/child)class, which in turn enables the base class to access the code of its base class. That means we extend our derived class functionality by inheriting the base class.

C# is supported only single inheritance. It is not supported multiple inheritance.


For more details: Click here


Don't want to miss updates? Please click the below button!

Follow MindStick