Junior
From PDF
OOP
C# OOP
What is the workaround for multiple inheritance in C#?
- Use interfaces to achieve multiple inheritance.
- A class can implement multiple interfaces.
interface IFlyable { void Fly(); }
interface IDriveable { void Drive(); }
class FlyingCar : IFlyable, IDriveable { public void Fly() {} public
void Drive() {} }
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png