Interviews2 answers
Can you declare a C++ type destructor in C# like ~MyClass()?
2 Answers
YES . but we should not use it generally ..
Akash VarshneyPosted Sep 28, 2015, 10:08 PM EDT
Yes, but what’s the point, since it will call Finalize(), and Finalize() has no guarantees when the memory will be cleaned up, plus, it introduces additional load on the garbage collector. The only time the finalizer should be implemented, is when you’re dealing with unmanaged code.
praveen_kk4Posted Jul 14, 2006, 3:58 AM EDT
