[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CSharpDestructor
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CSharpDestructor
(C#) Destructor
The destructor is the method called when a class instance is destroyed by the Garbage Collector. Therefore, you never know exactly when it is called. The method that is called when a class instance is created is called a constructor.
using System;
using System.Collections.Generic;
using System.Text;
namespace CreateClass
{
class Gossip
{
public Gossip()
{
Console.WriteLine("Gossip::Constructor");
}
~Gossip()
{
Console.WriteLine("Gossip::Destructor");
}
}
}
'Destructor' links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
