1.

For explicit call _________________(a) The destructor must be private(b) The destructor must be public(c) The destructor must be protected(d) The destructor must be defined outside the classThis question was addressed to me in homework.Query is from Execution of Constructor or Destructor in division Constructors and Destructors of Object Oriented Programming

Answer»

Right answer is (B) The destructor must be public

The BEST explanation: The destructor must be public for explicit calls. If it is made PRIVATE or PROTECTED then it won’t be ACCESSIBLE outside the class. There is no restriction of definition the destructor outside the class.



Discussion

No Comment Found

Related InterviewSolutions