I have an issue in my code which is :
i have 2 classes Parent and Child
- class Parent
- {
- List
Childs1 = new List (); - List
Childs2 = new List (); - Parent()
- {
- // Some Code
- }
- ~Parent()
- {
- Console.WriteLine("Hello World!!");
- }
- }
- class Child
- {
- // Some Code
- }
// Output :-
Hello World!!
Hello World!!
- Why the parent distructor is been called twice when instantiated in the main after the program is closed?

Gajendra JangidPosted Mar 25, 2019, 12:58 AM
Rajeesh MenothPosted Mar 25, 2019, 12:41 AM