Construction and Destructions of Objects
We will cover how to destroy objects explicitly and construct objects at run time by name.
We'll cover the following...
Destroying objects explicitly
The reverse operations of the new
operator are destroying an object and returning the object’s memory back to the GC
. Normally, these operations are executed automatically at unspecified times.
However, sometimes it is necessary to execute destructors at specific points in the program. For example, an object may be closing a File
member in its destructor and the destructor may have to be executed ...