What is the purpose of a destructor in OOP?ओओपी में एक विनाशक का उद्देश्य क्या है?
ओओपी में एक विनाशक का उद्देश्य क्या है?
Show answerHide answer
Correct answer: (C) To free up resources when an object is destroyedकिसी वस्तु के नष्ट होने पर संसाधनों को मुक्त करना
Explanation
A destructor runs automatically when an object is destroyed and releases its resources, such as memory, files or network connections.Destructor ऑब्जेक्ट नष्ट होने पर अपने आप चलता है और उसके संसाधन, जैसे मेमोरी, फाइलें या नेटवर्क कनेक्शन, मुक्त करता है।