1.

How Do Destructors And Garbage Collection Work In C#?

Answer»

C# has finalizers (similar to destructors except that the RUNTIME doesn't guarantee they'll be called), and they are specified as follows:
class C
{
~C()
{
// your code
}
public static void Main() {}
}
CURRENTLY, they OVERRIDE object.Finalize(), which is called during the GC process.

C# has finalizers (similar to destructors except that the runtime doesn't guarantee they'll be called), and they are specified as follows:
class C
{
~C()
{
// your code
}
public static void Main() {}
}
Currently, they override object.Finalize(), which is called during the GC process.



Discussion

No Comment Found