Name

Shadows Keyword

Syntax

Shadows

Description

When a member of a derived class has the same name as a member of the same type in the base class, and the keywords Overridable and Overrides are used appropriately, then the derived class member overrides the base class member. That is, any reference to the member using a derived class object refers to the implementation in the derived class.

Shadowing works in a similar way but allows any member type to “override” any other member type. Thus, for example, a method can “override” a property. For a complete discussion of shadowing (with an example), see Section 4.4.5 in Chapter 4.

VB.NET/VB 6 Differences

The Shadows keyword is new to VB.NET.

Get VB.NET Language in a Nutshell, Second Edition 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.