Inheritance in Visual Basic.NET: Demonstration

Category:
C#, VB.NET, ASP.NET
Type:
Classes
Difficulty:
Beginning
Author:
Intelligent Solutions Inc.

Version Compatibility: Visual Basic.NET

More information:
This application demonstrates inheritance in Visual Basic.NET. Two classes, a base class and a derived class are included in the project. The base class has three functions; the derived class overrides one of the three. The project demonstrates how to create base classes, how to declare functions so it is possible for child classes to override them, and, in the derived class, how to override the base class's implementation of a function.

Note that these classes validate strings and therefore probably have more real-world value than many inheritance examples typically available: most of the ones I've seen have Base classes like Animal and Derived classes like Dog and Cat. While illustrative of the concepts, these types of examples have little or no practical application.

The classes are contained in a Windows Forms project which uses them in a demonstration application. Refer to the comments within the code for more information. Originally developed for beta versions; verified to work in VB.NET v 1.0, 03/31/02.


Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

Download inheritancedemo.zip