Polymorphism

Polymorphism is the ability to change the implementation of a base class for different objects. For example, if you have a bicycle and a car, both can move, but they do so in very different ways. They use different mechanisms for movement, and the distance that each can move in an hour is significantly different. Yet, both a Car and a Bike class might inherit from a base Transportation class, which could also be used as the basis for a Plane class, a Train class, a HotAirBalloon class, and so on.

Polymorphism with Inheritance

Polymorphism was possible in VB6 using interfaces, which will be examined in a moment. VB .NET allows you to perform polymorphism using inheritance. The difference from what you have done so far is that you ...

Get A Programmer's Introduction to Visual Basic® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.