what is shadowing in .n开发者_StackOverflow中文版et
Shadowing in general:
In computer programming, variable shadowing occurs when a variable declared within a certain scope (decision block, method, or inner class) has the same name as a variable declared in an outer scope. This outer variable is said to be shadowed. This can lead to confusion, as it may be unclear which variable subsequent uses of the shadowed variable name refer to.
See Wikipedia
http://www.geekinterview.com/question_details/18405
http://www.aspfree.com/c/a/VB.NET/Shadowing-using-Shadows-in-Visual-Basic-NET-2005/
The terminology specific more into .Net.
Its techniuqe of replacing a member of a base class with a new member from the derived class. It differs from overriding in that base class's shadowed member is no longer available from the derived class.
精彩评论