主题:类的继承问题:
using System;
public class ParentClass
{
public ParentClass()
{
Console.WriteLine("Parent Constructor.");
}
public void Print()
{
Console.WriteLine("I'm a Parent Class");
}
}
public class ChildClass : ParentClass
{
public ChildClass()
{
Console.WriteLine("Child Constructor.");
}
public static void Main()
{
ChildClass child = new ChildClass() ;
child .Print();
}
}
看不明这段代码哪位高手帮忙说明一下呀谢谢
public class ParentClass
{
public ParentClass()
{
Console.WriteLine("Parent Constructor.");
}
public void Print()
{
Console.WriteLine("I'm a Parent Class");
}
}
public class ChildClass : ParentClass
{
public ChildClass()
{
Console.WriteLine("Child Constructor.");
}
public static void Main()
{
ChildClass child = new ChildClass() ;
child .Print();
}
}
看不明这段代码哪位高手帮忙说明一下呀谢谢