Mohd Arif
Explain the concept of destructor ?
By Mohd Arif in .NET on Dec 01 2015
  • Mohd Arif
    Dec, 2015 1

    A destructor is a special method for a class and is invoked automatically when an object is finally destroyed. The name of the destructor is also same as that of the class but is followed by a prefix tilde (~).A destructor is used to free the dynamic allocated memory and release the resources. You can, however, implement a custom method that allows you to control object destruction by calling the destructor.The main features of a destructor are as follows: Destructors do not have any return type Similar to constructors, destructors are also always public Destructors cannot be overloaded.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS