Learn to program in Visual Basic .NET, the right way

Classes - Inheritance

What is Inheritance?

Inheritance was revolutionary when object-oriented programming first came on the scene.

Inheritance is a mechanism to reuse code and to allows for extensions of the original Class.

Example

To inherit a Class, simply use the Inherits keyword as demonstrated in the following example:

Fiddle: Live Demo

Scoping

In the Modifiers lesson we learned about scoping and in Inheritance, scoping is needed to be considered.

If a property, method, or event is declared as Private in the parent Class, then it is not accessible in the inherited Classes.