+ 8
Why destructor is important to use
what happened if we do not use it.
4 odpowiedzi
+ 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