1.

Which among the following is true for destructors?(a) Destructors can be overloaded(b) Destructors can be define more than one time(c) Destructors can’t be overloaded(d) Destructors are overloaded in derived classesThe question was posed to me during an interview.The question is from Execution of Constructor or Destructor in division Constructors and Destructors of Object Oriented Programming

Answer»

Correct choice is (c) Destructors can’t be overloaded

The best I can explain: The destructors can NEVER be overloaded. The destructors doesn’t have arguments. And to get overloaded, they MUST have different SIGNATURE. This is not POSSIBLE if arguments are not allowed.



Discussion

No Comment Found

Related InterviewSolutions