Hi all,
I read something like "C# does not support multiple inheritance but it supports multilevel inheritance". what could be the reason for this? If it possible to achieve multiple inheritance in C# using some workaround?.
Thank you.
Hi all,
I read something like "C# does not support multiple inheritance but it supports multilevel inheritance". what could be the reason for this? If it possible to achieve multiple inheritance in C# using some workaround?.
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
Rajeesh MenothRank #118 · 18.4K reputationPosted Sep 10, 2015, 8:20 PM EDT
The Diamond problem is an ambiguity that arises when two classes B and C inherit from Class A and class D inherits from both B and C. If a method in D calls a method defined in A(and does not override the method), and B and C have overridden that method differently, then from which class does it inherit: B or C?
That is the reason why C# and Java languages does not support multiple inheritance.
Harshad PansuriyaRank #1,124 · 1.6K reputationPosted Sep 10, 2015, 8:14 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Sep 10, 2015, 9:22 PM EDT
What is wrong with multiple inheritance?
The main problem with multiple inheritance is that there can be times when the results of using multiple inheritance will be uncertain. The best example of this is the classic problem known as the diamond problem where a class inherits from 2 different classes, but those 2 different classes inherit from the same class,