Software Development Network>> Visual C#>> how do we implment multiple inheritence in c# pls
C# doesnot support multiple inheritance from more than one class though you can inherit from maximum 1 class and multiple interfaces.
Best Regards,
Rizwan
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
You can only inherit from one class, but you may inherit multiple interfaces:
interface ITest{}
interface ITest2{}
class Base{}
class Multiple : Base, ITest, ITest2{}
how do we implment multiple inheritence in c# pls
JD653687
C# doesnot support multiple inheritance from more than one class though you can inherit from maximum 1 class and multiple interfaces.
Best Regards,
Rizwan
SashaBr
spelger
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
Will C.404367
Jim Bennett
You can only inherit from one class, but you may inherit multiple interfaces:
interface ITest
{
}
interface ITest2
{
}
class Base
{
}
class Multiple : Base, ITest, ITest2
{
}