What is hiding and shadowing?

 Posted by Kmandapalli on 1/20/2014 | Category: ASP.NET Interview questions | Views: 1903 | Points: 40
Answer:

Shadowing is a vb.net concept by which we can provide new implementation for base class member without overriding the member. We can shadow abase class member in the derived class by using Shadows keyword. Method sigature, access level and return type of the shadowed member can be different than the base class.

Hiding
is a c# concept by which we can provide a new implementation for the base class member without overriding the member. A base class member can be hided in the derived class using the new keyword. Method signature, access level and return type of the hidden member should be same as the base class member.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response