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 difference between DELETE TABLE and TRUNCATE TABLE commands? Following are differences between delete & truncate commands:- 1)The DELETE TABLE syntax logs the de

Set up a FTP File Server and active FTP File Transfer using VB.NET The Job Description is as given: 1. Manually set up a FTP file server on a remote server. 2. Manually ad

What is V model in testing? The V model map's the type of test to the stage of development in the project. Figure: - V Model 1) Unit Testing: The Starting fro

Needed Expert Ruby in Rail Deveoloper - urgent Project Description: I require an expert Ruby on Rail developer. Need someone who has depth in knowledge of Ruby on Rail. Wi

Project Description: We are seeking someone who can write a program in C# or C++. The idea is to prepare the program using a Cross Platform environment like Mono or Qt which

What is an XMLReader Class? This is an abstract class available from the System.XML namespace. The XML reader works on a read-only stream browsing from one node to another in a

Problem: (a) Define the term ViewState as used in the ASP.NET framework. (b) What is a StateBag class? Give a simple example to support your answer. (c) (i) Distingui

Net project Project Description: We want to make .net project Microsoft Active Directory, PMS Lync 2010 - 2013 databases creating a license key for their SW generati

What are Value types and Reference types The Value types directly contain their data which are either allocated on the stack or allocated in-  Line in a  structure. The Refe

What are the metrics followed in project management? The most metric sets deal with a variation of these attributes and are chosen to help the project managers gain insight int