标签:
1.-----构造函数
public class Human()
{
public Human()
{
Console.Write("Human Constructure Function");
}
}
Public Class Chinese():Human
{
public Chinese()
{
Console.Write("Chinese Constructure Function");
}
}
Class Program()
{
static void Main(string[] args)
{
Chinese ch = new Chinese();
}
}
结果:
Human Constructure Function
Chinese Constructure Function
先运行父类构造方法,再子类的
标签:
原文地址:http://www.cnblogs.com/songjiefa/p/4695823.html