O'Reilly logo

Visual Basic 2010 Unleashed by Alessandro Del Sole

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

Overriding Members

When a class derives from another one, it inherits members, and the members behave as they are defined in the base class. (For this purpose remember the scope). As for other .NET languages, Visual Basic enables redefining inherited methods and properties so that you can change their behavior. This technique is known as overriding and requires a little work on both the base class and the derived class. If you want to provide the ability of overriding a member, in the base class you have to mark such member as Overridable. Let’s continue the example of the Person class, defined as follows:

image

The goal is providing derived classes ...

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