Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What is Shadowing in C# ?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 29-11-2009
Member
 
Join Date: Nov 2009
Posts: 61
What is Shadowing in C# ?
  

I have recently started to learn C# programming language. I am very much confused with the basic concepts of C#. I am that technically sound and same applies to programming for me. I want to know what is Shadowing concept in C#. I have tried to research a lot on this but failed to understand anything. Please help.

Reply With Quote
  #2  
Old 29-11-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: What is Shadowing in C# ?

Using the keyword 'new' a programmer can hide an inherited method. This is termed as Shadowing concept of Object Oriented Programming. And C Sharp also includes this shadowing concept. Let us assume that two elements of a program have the same name. in such a situation we can use one program element to hide another. This forms the Shadowing concept in C Sharp.
Reply With Quote
  #3  
Old 29-11-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: What is Shadowing in C# ?

I am aware of a type of Shadowing that C-sharp supports, it is called Shadowing through scope. C-sharp allows same name for elements of the programs which are in the same class or module but with difference in scope. This is known as Shadowing through scope in C-sharp. Even I was confused on this concept of Shadowing in C-sharp.
Reply With Quote
  #4  
Old 29-11-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: What is Shadowing in C# ?

There is a concept in C# to hide same named program element this is called Shadowing concept in C#. Shadowing is also possible through inheritance in C#. Any set of overloaded elements or declared elements can be shadowed with any other type. But do not mix shadowing concept with over riding-concept in C#.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What is Shadowing in C# ?"
Thread Thread Starter Forum Replies Last Post
Overriding and Shadowing in C# Sheenas Software Development 5 01-02-2010 07:45 PM
How to disable bios shadowing PinkShell Operating Systems 3 22-08-2009 08:39 PM


All times are GMT +5.5. The time now is 12:09 AM.