首先来一段代码,看一下继承的关系
class Monster
{
public void BeHit()
{
Console.WriteLine("基类Behit");
}
}
class Slam : Monster
{
public void BeHit()
{
Console.WriteLine("打史莱姆");
}
}
class Mario : Monster
{
public void BeHit()
{
Console.WriteLine("打马里奥");
}
}
class Program