What is shadowing?

Answer Posted / shalini

When two programming elements share the same name, one of
them can hide, or shadow, the other one. In such a
situation, the shadowed element is not available for
reference; instead, when your code uses the shared name,
the Visual Basic compiler resolves it to the shadowing
element.
Shadowing through inheritance is hiding a method of a
base class and providing a new implementation for the same.
This is the default when a derived class writes an
implementation of a method of base class which is not
declared as overridable in the base class. This also serves
the purpose of protecting an implementation of a new method
against subsequent addition of a method with the same name
in the base class.

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain diff. Between friend and protected friend?

501


Describe the sequence of action takes place on the server when ASP.NET application starts first time?

625


What is the difference between c# and .net?

585


What is the difference between session and viewstate?

520


What is viewstate in asp net with example?

527






Define a static class?

533


Name the namespace which is used by ado.net?

531


What is base class of .net?

540


How to find out what version of asp.net I am using on my machine?

585


What is bson in web api?

596


Can we use html in asp.net?

504


How do we assign page-specific attributes?

619


Which ASP.NET configuration options are supported in the ASP.NET implementation on the shared web hosting platform?

656


Is it possible to develop a single web application using ASP.NET webforms and ASP.MVC?

602


Describe session handling in a webfarm, how does it work and what are the limits?

586