Search⌘ K

What is Inheritance?

Explore the concept of inheritance in C# object-oriented programming to understand how new classes derive from existing ones. Learn about the IS A relationship, practical examples using shapes, programming languages, and beverages, and the significance of the built-in Object class in .NET. This lesson prepares you to apply inheritance syntax and terminologies effectively.

Now that you are familiar with the concepts of objects and classes, let’s discuss inheritance which is another key concept in object-oriented programming.

Definition

Inheritance provides a way to create a new class from an existing class. The new class is a specialized version of the existing class such that it inherits all the non-private fields (variables) and methods of the existing class. The existing class is used as a starting point or as a base to create the new class.

The IS A

...