Loading
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
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 8, 2013, 8:30 AM EDT
When we use the Multiple inherutance,we use more than one
class.Suppose class A and class B are base classes and
class c is is multiple inherting it.it may be possible that
this function with same name and same signature can present
in both class A and Class B .At this time how the compiler
will know which function it should take wherether from
class A or class B.
So Multiple inheritance won't work.
To avoid this problem we use Interface..... it means in
interface we just declare a function and in the derived
class we give the definition as per the requirement...means
function should be abstract ... and in interface all funcion
[method] should abstract
VulpesRank #55 · 29.2K reputationPosted Jul 8, 2013, 2:59 PM EDT
Riyaz AkhtarRank #2,275 · 619 reputationPosted Jul 8, 2013, 7:25 PM EDT
http://blogs.msdn.com/b/csharpfaq/archive/2004/03/07/85562.aspx
VulpesRank #55 · 29.2K reputationPosted Jul 9, 2013, 1:44 AM EDT
http://www.artima.com/intv/dotnet.html
Er Sharma2 reputationPosted Jan 13, 2015, 1:33 AM EST
Posted Jul 8, 2013, 7:12 PM EDT
Simply saying you are inheriting from your parent. How many parents you can have only one certainly not many, in other words not multiple parents.
This is the reason multiple inheritance is prohibited in C#. In other words C# is well attuned to real world scenario!
C# does provide an alternative to multiple inheritance, known as an interface.