+ 8
Why destructor is important to use
what happened if we do not use it.
4 RĂ©ponses
+ 9
@Valdemarđ
+ 8
thanks@Ismail
+ 4
To do some things you want before the destruction of the object like closing DB connection...
+ 4
In practice destructors are rarely coded in C#. It is much more common to have your class implement IDisposable interface and use an using statement unless you have unmanaged resources. But you will probably learn about this in the future âșïž
But if anyone is interested and wants a bit more info then you can read the correct usage here:
http://stackoverflow.com/a/898867