O'Reilly logo

Start Here!™ Fundamentals of Microsoft® .NET Programming by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Multiple Inheritance and Interface Implementation

Some programming languages allow multiple inheritance, where a class can inherit from more than one parent class. For example, suppose that you have a Domicile class and a Vehicle class. You might want a HouseBoat class or a MotorHome class to inherit from both those classes.

Unfortunately neither Visual Basic nor C# allows multiple inheritance. In fact, most object-oriented languages support only single inheritance. You can, however, gain some of the benefits of inheritance from multiple parent classes by using interfaces and composition.

In Visual Basic and C#, you can define an interface. An interface defines a set of members that a class can provide. A class that implements the interface must ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required