Using system;
Class a {public a () // Because this method is called because of an inherited class, this function cannot be saved, unless in the inherited structure, the {Console.Writeline ("a constructed") ("a constructed") ("a constructed") ("a constructed") ("a constructed") ("a constructed");
Public a (int a) {console.writeline ("a constructed has parameter";}
Public void methoda () {console.writeline ("call methoda");}
~ A () {console.writeline ("a destructed");}}
Class B: a {public b () {console.writeline ("b constructed");}
Public void methodb () {console.writeline ("call methodb");}
~ B () {Console.writeline ("b destructed");}};
Class c {public static void main () {a d; d = new a (7); d.Methoda ();
Console.writeLine ("**************");
B E = new b (); e.Methodb ();}}; running result: a Constructed Have ParameterCall Methoda ************* A Constructedb Constructeda Destructeda Destructed Destructed Decoction Call is when the GC is performed, so you cannot predict the destructor, where to run.