What is the purpose of a constructor in OOP?ओओपी में एक कंस्ट्रक्टर का उद्देश्य क्या है?
ओओपी में एक कंस्ट्रक्टर का उद्देश्य क्या है?
Show answerHide answer
Correct answer: (C) To initialize object propertiesऑब्जेक्ट गुणों को प्रारंभ करना
Explanation
A constructor is a special method that runs automatically when an object is created and sets the initial values of its properties. Destroying objects is the job of a destructor.कंस्ट्रक्टर एक विशेष मेथड है जो ऑब्जेक्ट बनते ही अपने आप चलती है और उसकी प्रॉपर्टी के शुरुआती मान तय करती है। ऑब्जेक्ट नष्ट करने का काम डिस्ट्रक्टर का है।