Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple inheritance
Message
From
20/05/2007 10:32:34
 
 
To
20/05/2007 05:36:28
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01227111
Message ID:
01227138
Views:
13
John,

You cannot have multiple inheritance in C#. The best you can do is inherit from one class and implement several interfaces. So, you could do this:
public class myClass : myBase1, IOne, ITwo, IThree
{
    // Then you must have the methods and properties of the Interfaces 
}
~~Bonnie



>Hi,
>How could I have multiple inheritance to two class in C#?
>I tried the code as below, but not success.
>
>
public class myClass : myBase1, myBase2
>{
>}
>
>Thank you
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform