how do we implment multiple inheritence in c# pls  
Author Message
R.Tutus





PostPosted: Visual C# Language, how do we implment multiple inheritence in c# pls Top

Thanks


Visual C#8  
 
 
Paul Louth





PostPosted: Visual C# Language, how do we implment multiple inheritence in c# pls Top

You can only inherit from one class, but you may inherit multiple interfaces:

interface ITest
{
}

interface ITest2
{
}

class Base
{
}

class Multiple : Base, ITest, ITest2
{
}


 
 
csharprocks.com





PostPosted: Visual C# Language, how do we implment multiple inheritence in c# pls Top

C# does not support multiple inheritance. Using multiple interfaces is only a way to mimick multiple inheritance. So actually you can't at this time.

The trick is to split your code allowing it to be more object oriented. One class inherits the base and the naext inherits it.

Hope this well helpful.

Craig Maslowski MCT



 
 
RizwanSharp





PostPosted: Visual C# Language, how do we implment multiple inheritence in c# pls Top

C# doesnot support multiple inheritance from more than one class though you can inherit from maximum 1 class and multiple interfaces.

Best Regards,

Rizwan



 
 
Paul Louth





PostPosted: Visual C# Language, how do we implment multiple inheritence in c# pls Top

Is there an echo in here
 
 
R.Tutus





PostPosted: Visual C# Language, how do we implment multiple inheritence in c# pls Top

thanks a lot guys.