Thursday, August 26, 2004

Overriding And Shadows

Overloading allows a subclass to add a new variation of a method. As long as the new variation has a different method signature, it can have the same name as an existing method on the base class.Shadowing, on the other hand, entirely replaces all variations of the method from the base class, leaving the subclass with only a single version of the method—the one we created through shadowing. Shadowing does not extend an interface, but rather replaces existing methods.Overriding allows a subclass to alter or replace an existing method with the permission of the base class designer. Shadowing can be done without the permission of the base class designer, which is a risky proposition and one that requires extensive testing because the base class was never designed with such a thing in mind.http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet12252001.asp