using System;
using System.Collections.Generic;
using System.Text;namespace console
{
class one
{
public one()
{
System.Console.WriteLine("The one");
} ~one()
{
}
}
class two : one
{
public two()
{
System.Console.WriteLine("The two");
} ~two()
{
} } class three : two
{
public three()
{
System.Console.WriteLine("The three");
} ~three()
{
}
} class Program
{
static void Main(string[] args)
{
three t = new three();
System.Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Text;namespace console
{
class one
{
public one()
{
System.Console.WriteLine("The one");
} ~one()
{
}
}
class two : one
{
public two()
{
System.Console.WriteLine("The two");
} ~two()
{
} } class three : two
{
public three()
{
System.Console.WriteLine("The three");
} ~three()
{
}
} class Program
{
static void Main(string[] args)
{
three t = new three();
System.Console.ReadKey();
}
}
}
three t = new three();构造的顺序是
The one
The two
The three
析构的顺序就为
The three
The two
The one
three t = new three();构造的顺序是
The one
The two
The three
析构的顺序就为
The three
The two
The one
The three
The two
The one