What is method Shadowing?
explain with real time example.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Mar 26, 2014, 1:18 AM
Hi,
Shadowing is concept of VB.
Name suggest itself... It hides method in a base class.
class A
{
public int TestMethod(){ return 5;}
public virtual int TestMethod1(){return 5;}
}
class B : A
{
public int TestMethod() { return 1;}
public override int TestMethod1() {return 1;}
}
here TestMethod of class B is shadow TestMethod of base class A.
hope this will help you.
VulpesPosted Mar 25, 2014, 2:50 PM
The output is: