在你所继承的父类里声明一个virtual的方法就可以了。如:
public class hello
{
public virtual void show(string msg)
{
.....
}
} public class hello2:hello
{
public override void show(string msg)
{
.......
base.show();
}
public class hello
{
public virtual void show(string msg)
{
.....
}
} public class hello2:hello
{
public override void show(string msg)
{
.......
base.show();
}
this.Show();改成this.Show("");绝对pass.