开发者

What is shadowing?

开发者 https://www.devze.com 2022-12-19 11:02 出处:网络
what is shadowing in .n开发者_StackOverflow中文版etShadowing in general: In computer programming, variable

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消