L
LP
Hello!
I am moving from VB.NET to C#.
Could someone explain to me what is the purpose of destructor in C# class if
GC destroys the object on its own timing. What's the difference between
destructor such as ~className and IDisposable.Dispose and finalize method.
At what point destructor gets called? Doest it get invoked by GC or by the
client. I thought finalize method gets called by GC right before it destroys
the object, or is it a VB.NET thing. I am confused.
Thank you
I am moving from VB.NET to C#.
Could someone explain to me what is the purpose of destructor in C# class if
GC destroys the object on its own timing. What's the difference between
destructor such as ~className and IDisposable.Dispose and finalize method.
At what point destructor gets called? Doest it get invoked by GC or by the
client. I thought finalize method gets called by GC right before it destroys
the object, or is it a VB.NET thing. I am confused.
Thank you