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() {} }

More from C# Programming Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details