"Laurent Allardin" <la******@2k1soft.com> wrote
Why this code compile???
We should not be able to Override the code by using the Overloads since the
sub as exactly the same parameters....
That is called shadowing by name and signature. From the help file:
-----------
Derived classes can overload inherited members with members that have identical parameters and parameter types, a process known
as shadowing by name and signature. If the Overloads keyword is used when shadowing by name and signature, the derived classes
implementation of the member will be used instead of the implementation in the base class, and all other overloads for that
member will be available to instances of the derived class.
If the Overloads keyword is omitted when overloading an inherited member with a member that has identical parameters and
parameter types, then the overloading is called shadowing by name. Shadowing by name replaces the inherited implementation of a
member, and makes all other overloads unavailable to instances of the derived class, and its decedents.
--------------
HTH
LFS