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


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
How can you identify whether or not any changes are made to the DataSet object as it was last loaded? The DataSet object provides the following two methods to track down the ch

Explain Custom Activities. In addition to the standard activities available within the base activity library, you can make new activities to meet exact business needs. Creating

Project Description: i want to prepare a pollution checking software.. i have a demo of it.. Exactly someone to be created ..some changes to be included.. sms gateway t

Sorting 2 Arrays & Merging into 1 - C# Program Hello, i didn't find the correct way to implement Array in my project. I am beginner for this language.  Please suggest me some

Ask queyuyuystion #Minimum 100 words accepted#

Full time contractual programming position (mostly scraping, databasing) Project Description: This is a full time contractual role needed for a sports advisory service. We ar

Custom Mql4 Code/Fxdreema block Project Description: I need the subsequent code written in mql4 and integrated as custom block(s) in fxdreema: for each trade: check pro

What are shared (VB.NET)/Static(C#) variables? Shared/Static classes are used when a class gives functionality which is not specific to any instance. In brief if you want an ob

I want the iTunes producer GUI reproduced in ASP.NET MVC using c# / html / js. The part involved deals with creating album / track metadata. The data entered on the website form