Shadows Keyword


Shadows Keyword

Description

The Shadows keyword identifies a type member in a derived class that masks another member of the same name, as found in the base class.

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. 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. For example, a method can "override" a property, or a constant can "override" a delegate. For a complete discussion of shadowing, see the "Shadowing and Overloading Members" section of Chapter 3.

Version Differences

The Shadows keyword is new to VB under .NET.




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net