Forced garbage collection
using System;
class Junk
{
public Junk()
{
Console.WriteLine("Created Junk");
}
~Junk()
{
Console.WriteLine("Destroyed Junk");
}
}
class MainClass
{
public static void Main()
{
Junk j = new Junk();
j = null;
GC.Collect();
}
}
Output Created Junk
Destroyed Junk
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
|