USing shadow in vb.net and its equivalent in c#.

  • Thread starter Thread starter trialproduct2004
  • Start date Start date
T

trialproduct2004

Hi all,

can any one tell me use of shadow keyword in vb.net and its equivalent
in c# with e.g.

Please help me.

thanks in advance.
 
Hi all,

can any one tell me use of shadow keyword in vb.net and its equivalent
in c# with e.g.

Please help me.

thanks in advance.

The shadow keyword allows you to hide a base implementation in an inheritance
hiearcy. This is useful in situations, such as a base class change declaring
a method already defined in your derived class. Redifining access levels, or
the readability/writeability of a property... Look in the documentation on
the shadows keyword and you will see examples and explanations of it's use.

The C# equivalent is new (not to be mistaken with new :)

public class TheClass
{
public bool TheMethod ()
{
return true;
}
}

public class TheOtherClass : TheClass
{
new public bool TheMethod ()
{
return false;
}
}

HTH,
 
Back
Top