hi firends
i have a base class and a child class.i write a method with its document in my parent class and i want to change that document in my child.both class and method are static.then i want when parogrammer use of this method from child level show differenet document .
Loading
Sam HobbsPosted Mar 3, 2010, 2:00 PM
Kirtan PatelPosted Mar 3, 2010, 10:22 AM
you need to make Parent Class Method Virtual and then Override it in Class B
class A
{
public virtual void a()
{
Console.WriteLine("I m In Class A");
}
}
class B : A
{
public override void a()
{
Console.WriteLine("I m Overrided in Class B");
}
}
zhong chenPosted Mar 3, 2010, 9:24 AM
{
public static void a()
{
Console.Write("a");
}
}
public class B:A
{
public static new void a()
{
Console.Write("b");
}
}