weird0 <am********@gmail.comwrote:
Suppose i have two classes A and B:
class A
{
public method_a();
}
class B
{
public method_b();
}
if i want to have multiple inheritance in c# like C++ so i can have
access to both methods:
class C : public A,B
{
public method_c();
}
HOw can i achive that in c#?
You just can't. In general, prefer composition to inheritance - so
class C would have an instance of A and an instance of B as member
variables.
Note that although .NET has no multiple inheritance of implementation,
you can implement multiple interfaces.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too