Advertisements
Advertisements
प्रश्न
Given the following C++ code, answer the following question.
class TestMeOut
{
public:
~TestMeOut() //Function 1
{cout<<“Leaving the exam hall”<<endl;} TestMeOut() //Function 2
{cout<<“Appearing for exam”<<endl;}
void MyWork() //Function 3
{cout<<“Answering”<<endl;} };
In Object-Oriented Programming, what is Function 1 referred to, and when does it get invoked/called?
एका वाक्यात उत्तर
उत्तर
Function 1 is the ‘destructor’.
It is executed automatically when an object of the class TestMeOut goes out of scope.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?