1.

Global destructors execute in ___________ order after main function is terminated.(a) Sequential(b) Random(c) Reverse(d) Depending on priorityThis question was posed to me in semester exam.The query is from Destructors topic in section Constructors and Destructors of Object Oriented Programming

Answer»

Right option is (c) REVERSE

Easiest explanation - The destructors are ALWAYS called in reverse order no matter which destructor it is. This is done to ensure that all the RESOURCES are able to get free. And no RESOURCE is KEPT busy.



Discussion

No Comment Found

Related InterviewSolutions