class Program
{
static void Main(string[] args)
{
student St1 = new student();
St1.Pclass();
Dstudent Ds1 = new Dstudent();
Ds1.Pclass();
Console.ReadKey();
}
}
class student
{
public void Pclass()
{
Console.WriteLine("我是父类方法");
}
}
class Dstudent:student
{
public new void Pclass()
{
Console.Write("我是子类方法后面跟的是我通过Base调用的父类方法->");
base.Pclass();
}
} |