- 2
Why is a destructor called when an object is created?
6 Answers
+ 4
When an object is created, a constructor is called, not a destructor. A destructor is called when an object is destroyed.
+ 2
the object is destroyed at the end of the program.
+ 1
when an object is created the constructor gets called. the deconstructor instead is called when the garbage collector decide it or when you dispose of the object yourself
0
It's... not. It shouldn't be. Why, is there something wrong with a code you are working on?
0
A constructor is called when object is created. A destructor is called when the execution of code is end & need to destroy the object.
0
Don't know why I asked this, prob becouse something that was in de c# tutorial that was wierd for me