Shadowing, DOT NET Programming

What is shadowing?

When 2 elements in a program have similar name, one of them can hide and shadow the one. Therefore in such cases the element which shadowed the main element is referenced. The sample code is below in which, there are two classes "ClsParent" and "ClsShadowedParent". In the "ClsParent" there is a variable "x" which is an integer. "ClsShadowedParent" overrides the "ClsParent" and shadows the "x" variable to a string.

Public Class ClsParent

Public x As Integer

End Class

Public Class ClsShadowedParent

Inherits ClsParent

Public Shadows x As String

End Class

1574_shadowing.png

Figure:-Shadowing in Action

Posted Date: 9/22/2012 3:06:13 AM | Location : United States







Related Discussions:- Shadowing, Assignment Help, Ask Question on Shadowing, Get Answer, Expert's Help, Shadowing Discussions

Write discussion on Shadowing
Your posts are moderated
Related Questions
What is the use of a .disco file? A client application uses a .disco file to locate or discover the documents that have the description of a Web service. The .disco file having

If one of your validations is complicated and does not fit in any validators, what you do? The best way is to go for CustomValidators. The sample code for a custom validator

What is Reflection?  It extends the advantages of metadata by allowing developers to inspect and use it at runtime. For example, dynamically determine all the classes contained

Is spending in projects constant throughout the project? Generally in initial stage of projects (design and requirement phase) the cost is very less (as you require maximum bus

Here's the General Background on our project work: We need your help building out a new application that's part of a new startup in the Silicon Valley. We've built a fairly s

How can we get the state of the requested process? XMLHttpRequest get the current state of the request operation by using the readyState property. This property checks the cond

C# Programming 1. What is .Net Framework? 2. Write short notes on constructors and destructors. 3. Explain boxing and unboxing with examples. 4. What is a mixed mode a

I want .Net Programmer for custom grid web application Need programmer to support in the development of an ASP .Net interface. Project will make extensive utilize of custom grid

I want simple code for Outlook (express,2003,2007,2010,2013) Add-In with functionality to routinely send CC to the specified email(s), this system should have -Code for every th

What is the difference between "using System.Data;" and directly adding the reference from "Add References Dialog Box"? When you compiles a program using command line, u add th