Concept of the Destructor

Explain concept of the Destructor?

E

Expert

Verified

A Destructor is a special method for the class and is called automatically whenever an object is to be finally destroyed. Name of the destructor is also same as the class name but it is followed by a prefix tilde (~).
A destructor is used to free the dynamic allocated memory and thus release the resources. You may, implement a custom method which permits you to control the object destruction by invoking the destructor.

The main attributes of the destructor are as follows:

a) As constructors, destructors are also always public.

b) Destructors does not have any return type.

c) We cannot overload Destructors.

   Related Questions in DOT NET Programming

©TutorsGlobe All rights reserved 2022-2023.