Multiple inheritance may allow you to write compact code but it is not come of free
it make the program difficult to understand or debug simplicity and making it easy to write robust code is one of c# design goals in other hand multiple inheritance have common problems like
diamond problem for example
class MyBase
{ public abstract void Test(); } class FirstChild : MyBase
{ public override void Test() { Debug.WriteLine("First Child"); } } class SeconedChild : MyBase
{ public override void Test() { Debug.WriteLine("SeconedChild"); } } //Now Suppos that c# support multiple inheritance
class AnotherChild : FirstChild, SeconedChild { } //now some where in your program
Multiple inheritance may allow you to write compact code but it is not come of free
ReplyDeleteit make the program difficult to understand or debug simplicity and making it easy to write robust code is one of c# design goals in other hand multiple inheritance have common problems like
diamond problem for example
class MyBase
{
public abstract void Test();
}
class FirstChild : MyBase
{
public override void Test()
{
Debug.WriteLine("First Child");
}
}
class SeconedChild : MyBase
{
public override void Test()
{
Debug.WriteLine("SeconedChild");
}
}
//Now Suppos that c# support multiple inheritance
class AnotherChild : FirstChild, SeconedChild
{
}
//now some where in your program
//you write some thing like
AnotherChild child=new AnotherChild();
child.Test();
Thanks alka for that reply
ReplyDeleteBECAUSE VB DON'T HAD MULTIPLE INHERITANCE. C# CREATED USING VB
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHey Nice Post, Keep Updating more question and answers
ReplyDeletehttp://allittechnologies.blogspot.com/
You Can Aks Any Topic in this webste Answers & Questions & You Can Get Answer Asap ! So Why To Late ? Just Join This Community !
ReplyDelete