InterviewSolution
Saved Bookmarks
| 1. |
What Is The Sequence Of Destruction Of Local Objects? |
|
Answer» The destructor is executed in the REVERSE order of a CONSTRUCTOR. Firstly, the OBJECTS are constructed, METHODS are INVOKED on them, and then they are destructed. In the following example, a's destructor will be executed after b's destructor. The destructor is executed in the reverse order of a constructor. Firstly, the objects are constructed, methods are invoked on them, and then they are destructed. In the following example, a's destructor will be executed after b's destructor. |
|