Dela via


Inheritance in Visual Basic

Visual Basic supports inheritance, which is the ability to define classes that serve as the basis for derived classes. Derived classes inherit, and can extend, the properties, methods, and events of the base class. Derived classes can also override inherited methods with new implementations. By default, all classes created with Visual Basic are inheritable.

Inheritance lets you write and debug a class one time and then reuse that code as the basis of new classes. Inheritance also lets you use inheritance-based polymorphism, which is the ability to define classes that can be used interchangeably by client code at run time, but with functionally different, yet identically named methods or properties.

In This Section