How do you establish multiple inheritance in C#?Multiple
inheritance is where an entity extends behavior of more than one entity.
In Java, you establish multiple inheritance through classes because a
class can inherit from more than one class. But in C#, a class can inherit
from only one class. Then how do you establish multiple inheritance in C#? You can achieve it using interfaces. In C# though a class can inherit from only one class, the same class can implement more than one interface. Here is an example demonstrating multiple inheritance in C# using interfaces: interface
sampleInterface1 { Output of this code will be: Extending
sampleMethod1of sampleInterface1
FREE
Subscription
Subscribe
to our mailing list and receive new articles Note
: We never rent, trade, or sell my email lists to Visit
.NET Programming Tutorial Homepage ______________________________________________________ |