我发现互联网上的每一个都无法继承构造函数。但是当我测试它时,派生类也将通过基类。请参阅下面的代码。有人可以解释一下我看错了吗?
namespace Test
{
class Program
{
static void Main(string[] args)
{
Derived D = new Derived();
Console.Read();
}
}
public class Base
{
public Base()
{
Console.WriteLine("Inside Base Destructor");
}
}
public class Derived : Base
{
public Derived()
{
Console.WriteLine("Inside The Derived Constructor");
}
}
}