What is inheritance, Does C# support multiple inheritance
Loading
What is inheritance, Does C# support multiple inheritance
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Quinn Lillian14 reputationPosted Jun 18, 2025, 3:22 AM EDT
C# does not support multiple inheritance of classes, but it allows multiple interfaces to be implemented.
Saurabh PrajapatiRank #287 · 8.8K reputationPosted Jun 18, 2025, 3:04 AM EDT
Inheritance is an object-oriented programming (OOP) concept where a class (called a derived or child class) inherits properties and behaviors (methods and fields) from another class (called a base or parent class).
It promotes code reuse.
It models "is-a" relationships
No, C# does not support multiple inheritance.
Sudarshan HajareRank #741 · 3.1K reputationPosted Aug 6, 2026, 1:15 AM EDT
What is inheritance? It's a way of creating a new class (the derived class) from an already-existing class (the base class), so the derived class automatically gets access to the base class's variables and methods — without rewriting any of that code. It's mainly used for code reuse.
Does C# support multiple inheritance? No — a class in C# can only inherit from one base class. If you try to derive from two classes at once, you'll get a compile-time error. (You can get similar flexibility using interfaces, since a class can implement multiple interfaces — just not multiple classes.)
I actually wrote a full article covering inheritance in depth, including the exact multiple-inheritance error and why C# enforces this: Diving in OOP (Polymorphism and Inheritance – Part 2). Here you can learn about inheritance and get the answer to "Does C# support multiple inheritance" with working code and the actual compiler error.
Priya Sathish42 reputationPosted Aug 6, 2026, 5:23 AM EDT
No, Multiple inheritance of classes is not supported in C#, a class can inherit from only one base class.
Tuhin PaulRank #7 · 71.9K reputationPosted Aug 6, 2026, 8:57 AM EDT
See the above image for your answer
Sandhiya PriyaRank #26 · 43.2K reputationPosted Oct 27, 2025, 12:29 AM EDT
What is Inheritance in C#?
Inheritance is an OOP feature that allows one class (child) to reuse and extend the properties and methods of another class (parent).
Definition: Inheritance is a mechanism where a derived class (child) acquires the features (fields, methods, properties) of a base class (parent).
Syntax Example
// Base class (Parent) public class Animal { public void Eat() { Console.WriteLine("Animal is eating..."); } } // Derived class (Child) public class Dog : Animal { public void Bark() { Console.WriteLine("Dog is barking..."); } }Usage:
Dog d = new Dog(); d.Eat(); // inherited from Animal d.Bark(); // from Dog classOutput:
Here:
Animal? Base classDog? Derived class:? Indicates inheritanceWhy Use Inheritance?
? Reuse existing code
? Improve maintainability
? Create hierarchical class structures
? Enable polymorphism (method overriding)
Types of Inheritance in C#
Does C# Support Multiple Inheritance?
No, C# does not support multiple inheritance with classes
(i.e., you can’t inherit from more than one base class).
Example (Not Allowed):
public class A { } public class B { } public class C : A, B { } // Error: C# does not support multiple base classesBut C# Supports Multiple Inheritance via Interfaces
You can implement multiple interfaces in one class.
public interface IReadable { void Read(); } public interface IWritable { void Write(); } public class Document : IReadable, IWritable { public void Read() => Console.WriteLine("Reading document..."); public void Write() => Console.WriteLine("Writing document..."); }Output:
So: C# supports multiple inheritance using interfaces, not with classes.
This avoids the “diamond problem” (ambiguity when multiple base classes define the same method).
Summary Table
Quick Example Summary
public class Vehicle { public void Move() => Console.WriteLine("Vehicle moving..."); } public class Car : Vehicle { public void Honk() => Console.WriteLine("Car honking..."); } Car c = new Car(); c.Move(); // inherited c.Honk(); // own method