What problems you find with inheritance? Is multiple inheritance supported in C#?

  • Inheritance is one of the characteristic features of Object Oriented Programming languages.
  • Inheritance provides extension of a base functionality of a parent class by its child classes or derived classes.
  • Although inheritance improves code-reuse and extension, overusing it might add to code complexity and make code less readable.
  • There are different types of inheritance possible:
    • Simple - One parent, One Child
    • Multi-level - a chain of parent-child classes
    • Tree - One parent, multiple child
    • Multiple - multiple parents, one child
  • C# support all three inheritances while it doesn't support multiple inheritance. In C# you can extend only one concrete parent class, while you can implement more than one interfaces.

Object Oriented Programming Concepts - Inheritance

  • Inheritance is one of the characteristic features of Object Oriented Programming languages.
  • Inheritance provides extension of a base functionality of a parent class by its child classes or derived classes.
  • Although inheritance improves code-reuse and extension, overusing it might add to code complexity and make code less readable.
  • There are different types of inheritance possible:
    • Simple – One parent, One Child
    • Multi-level – a chain of parent-child classes
    • Tree – One parent, multiple child
    • Multiple – multiple parents, one child
  • C# support all three inheritances while it doesn’t support multiple inheritance. In C# you can extend only one concrete parent class, while you can implement more than one interfaces.

Object Oriented Programming Concepts – Inheritance

Sriram Mannava
Sriram Mannava

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity.

Leave a Reply

Your email address will not be published. Required fields are marked *