Advertisements
Advertisements
प्रश्न
What is Destructor?
लघु उत्तरीय
Advertisements
उत्तर
- A destructor, as the name suggests, is used to remove or destroy objects that are created by a constructor.
- 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.
- It is considered a good programming practice to define destructors, as they help in releasing memory space for future use.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2024-2025 (March) Official
