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
Need to get a windows desktop application developed Project Description: I am looking to obtain a desktop application developed. The desktop application will have the subsequ

Require Guys in Gaming Tracks Company for a mobile game developing Project Description: I want a team of game developers for life-time as mobile dev team in my company. So, i

I need a program that mimics the similar functionality as the link below. Program must have a unique user interface. Must add source code, installer, and of course a nice user i

What is the use of "Must Inherit" keyword in VB.NET? If you want to create an abstract class in the VB.NET it is done by using the "MustInherit" keyword.You can't create an obj

Checking for validity of an expression - C# Program Hello can you please provide me some examples regarding to the Checking for validity of an   expression in C#.

Hello, I want to develop one crystal report. I have one database which has 5 field.One is string and others are Boolean. String field name is State and Four remaining fields are Th

Project Description: I am seeking some automated trading software for the given strategy, I am using Omnesys Nest trader Step 1: Buy one share at current market price (ex:

What are the steps involved to fill a dataset ? The sample code is shown below: Private Sub LoadData() Dim strConnectionString As String strConnectionString = AppSetti

I want high skilled C++ programmers Project Description: I want to hire the developer, who are proficient in C/C++ and have experience with STL and work with the data structu

What is the difference between OLEDB Provider and SqlClient? With respect to usage, there is no difference among OLEDB Provider and SqlClient. The dissimilarity lies in their p