When to call Constructor and Destructor?

来源:互联网 发布:java图片转base64 编辑:程序博客网 时间:2024/06/11 07:56

 

 

Output:

Global1 constructor
Global2 constructor
Main1 constructor
Local1 constructor
Temporary1 constructor
Temporary1 destructor
Temporary2 constructor
Temporary2 destructor
Local2 constructor
Local2 destructor
Local1 destructor
Main2 constructor
Main2 destructor
Main1 destructor
Global2 destructor
Global1 destructor