1.

The destructors ____________(a) Have a return type(b) May have a return type(c) Of derived classes have return type(d) Doesn’t have a return typeI have been asked this question during a job interview.My question is based upon Execution of Constructor or Destructor topic in portion Constructors and Destructors of Object Oriented Programming

Answer»

The correct choice is (d) Doesn’t have a return type

The best explanation: The destructors are intended to FREE the memory space. And all the resources that were ALLOCATED for the OBJECT. The return VALUE is not supported SINCE only memory has to be made free.



Discussion

No Comment Found

Related InterviewSolutions