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 int and int32. There is no difference among int and int32. System.Int32 is a .NET Class and int is an alias name for System.Int32.

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

What does a break statement do in the switch statement? The switch statement is a selection control statement that is used to handle many choices and transfer control to the ca

I have to develop a Google Map Fix .NET Site on Android(maybe Cross Browser issue) Project Description: A developer has implemented a characteristic which involves data from

What is XML DOM? The DOM stands for Document Object Model, which explains the logical formation of documents and provides the way to access and manipulate a document. It suppli

Explain project life cycle. Figure: -Life cycle of a project There are 5 stages of any project initiating, planning, executing, controlling, & closeout. These are the

Need to copy values from one database to another AND Enhancements in MVC website. Project Description: Basically, you are asked to create an app that copy values from one DB

What is "AutoPostBack" feature in ASP.NET? If we want to control the automatically postback in case of any event, we will need to check the attribute as true. For example on a

Explain Dataset Accept Changes and Data Adapter Update methods?  Data Adapter Update method Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated

What are tuples? Tuple is a fixed-size collection that can have elements of either similar or different data types. Same to arrays, a user must have to specify the size of a tu