हिंदी

What is Destructor?

Advertisements

प्रश्न

What is Destructor?

लघु उत्तरीय
Advertisements

उत्तर

  1. A destructor, as the name suggests, is used to remove or destroy objects that are created by a constructor.
  2. The destructor is automatically called by the compiler when the program ends or when an object of the class goes out of scope, in order to free memory that is no longer needed.
  3. It is considered a good programming practice to define destructors, as they help in releasing memory space for future use.
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?

APPEARS IN

Advertisements
Share
Notifications



      Forgot password?
Use app×