Hello friends, I never ever use a class destructor, and now I want to try to using destructor, but I have a small problem.
My code is:
using System;
using System.Text;
namespace ConstTest
{
class test
{
public test()
{
Console.WriteLine("Start...");
}
~test()
{
Console.WriteLine("End...");
}
}
class Program
{
static void Main(string[] args)
{
test t = new test();
Console.Read();
}
}
}
And now, when I run the application then only displays "Start...", the destructor is not works. :/
Could someone give me an explanation about the problem ?
Thanks.