Inheriting from a Class

Inheritance allows you to derive a new class from an existing class. Suppose that class C inherits from class B. Then class B is typically called the base class, and class C is called the derived class. Note that this terminology is not necessarily standard; some refer to B and C as superclass and subclass, or as parent and child classes, respectively. This book will stick with the terms “base” and “derived.”

A derived class definition automatically inherits the implementation and the programming contract of its base class. The idea is that the derived class starts with a reusable class definition and modifies it by adding more members or by changing the behavior of existing methods and properties.

One of the primary reasons ...

Get Building Applications and Components with 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.