1.

What is the sequence of destructors call?(a) Same order as that of the constructors call(b) Random order(c) According to the priority(d) Revere of the order of constructor callI got this question during an interview for a job.This key question is from Execution of Constructor or Destructor in division Constructors and Destructors of Object Oriented Programming

Answer»

Right OPTION is (d) REVERE of the order of CONSTRUCTOR call

To EXPLAIN: The destructors are called in the reverse order as that of the constructors being called. This is DONE to ensure that all the resources are released in sequence. That is, the derived class destructors will be called first.



Discussion

No Comment Found

Related InterviewSolutions