---
title: "What is Inheritance?"  
description: "What is Inheritance?"  
author: "Shikhar Arora"  
published: 2019-11-07  
updated: 2019-11-07  
canonical: https://www.mindstick.com/forum/145451/what-is-inheritance  
category: "c#"  
tags: ["c#", ".net", "oops", "programming language"]  
reading_time: 2 minutes  

---

# What is Inheritance?

What is [Inheritance in C#](https://www.mindstick.com/forum/158920/explain-the-concept-of-inheritance-in-c-sharp-and-provide-an-example)?

## Replies

### Reply by Shikhar Arora

[Inheritance](https://www.mindstick.com/articles/13095/inheritance-and-its-types) is the ability to access methods and properties of the base class or parent class in the child class.

```
namespace Inheritance
{
 // Base class or parent class for Manager class.
    class Employee
    {
        public void EmpTask()
        {
            Console.WriteLine("Task for Employee");
        }
    }
 //child class for Employee class
 //base or parent class for Program class
    class Manager:Employee
    {
        public void ManTask()
        {
            Console.WriteLine("Task for Manager");
        }
    }
 //Child class for Employee and Manager Class
    class Program:Manager
    {

        static void Main(string[] args)
        {
            Program obj = new Program(); //Instantiating Program class
      //calling methods from Employee class and Manager class
            obj.EmpTask();
            obj.ManTask();
            Console.ReadLine();
        }
    }
}
```


---

Original Source: https://www.mindstick.com/forum/145451/what-is-inheritance

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
