110,535
社区成员
发帖
与我相关
我的任务
分享
using System;
namespace ConsoleApplication1
{
public class father
{
public virtual void a()
{
Console.WriteLine("a");
}
}
public class child: father
{
public void c()
{
Console.WriteLine("c");
}
public override void a()
{
base.a ();
Console.WriteLine("d");
}
}
class Class1
{
static void Main(string[] args)
{
father aa = new father();
aa.a();
child bb = new child();
bb.c();
bb.a();
father dd =new child();
dd.a();
//child ff = new father();
//ff.a();
Console.ReadLine();
}
}
}