As I am working as a C#
developer, I know that we can implement multiple inheritance
by use of Interface
.
Can anybody please provide me link OR code for how to achieve multiple inheritance
with C#
.
I want code for how to achieve multiple inheritance in C#
with the use of Interface
.
Thanks in advance.
It's not strictly multiple inheritance - but your C# class can implement multiple interfaces, that's right:
public class MyClass : BaseClass, IInterface1, IInterface2, IInterface3
{
// implement methods and properties for IInterface1
..
// implement methods and properties for IInterface2
..
// implement methods and properties for IInterface3
..
}
You need to provide implementations for all methods (and properties) defined in all of the interfaces you're planning to implement.
I'm not quite clear on what you are looking for from your question.... can you clarify a bit?? What are you trying to do? Where are you running into trouble??
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With