Bucky
Well-known member
How do I hide a base class member (a method in this case) so
that only the member of the inherited class can be used, even if
the members are of different types and have different parameters?
Take the following example:
As you can see, the InheritedClass.Moo() method will overload the
Moo method for that class. But how can I make it so that the
inherited method overrides the base method, even though they
have different parameters? This can be accomplished in VB.NET
with the Shadows modifier, but what is the C# equivalent?
that only the member of the inherited class can be used, even if
the members are of different types and have different parameters?
Take the following example:
C#:
public class BaseClass
{
public string Moo()
{
return "Base class moo!";
}
}
public class InheritedClass : BaseClass
{
public string Moo(string text)
{
return "Inherited class moo! - " + text;
}
}
As you can see, the InheritedClass.Moo() method will overload the
Moo method for that class. But how can I make it so that the
inherited method overrides the base method, even though they
have different parameters? This can be accomplished in VB.NET
with the Shadows modifier, but what is the C# equivalent?