About exception
来源:互联网 发布:js ui框架 编辑:程序博客网 时间:2024/06/11 23:17
1 clear up in the try{ }catch{ }
if exception happen, the system first clear up the objects which have been created in the try block,then go into the catch block;
if objects in array happen error during initialization,such as A array = new A[ 7] and some error happen in initializing the object array[3], then the handling system will auto call delete[ ] to properly release the storage.
2 no mathcing coversions
//C23Autoexcp.cpp#include <iostream>using namespace std;class Except1 {};class Except2 {public: Except2(Except1&) {}};void f() { throw Except1(); }int main() { try { f(); } catch (Except2) { cout << "inside catch(Except2)" << endl; } catch (Except1) { cout << "inside catch(Except1)" << endl; } cin.get();}Output: inside catch(Except1)
when f( ) throw Except1( ) , the first handler will not convert an Except1 object into an Except2 by calling constructer; so you will end up at second handler.However a base-class handler can catch a derived-class exception;
- About Exception
- About exception
- About Exception
- Java Tips -- About Exception
- About exception of Java
- about Exception and soapSeralization
- About Exception Handling
- About Java Exception
- [c#] About exception
- About Concurrent Modification Exception
- [ios] compile exception about ARC
- 简述java中的自定义异常的写法----about My Exception
- About Exception "ORA-01000: maximum open cursors exceeded"
- about:
- about
- About
- About
- About
- AIX6.1系统安装配置手册
- 关于无向图判断是否存在回路的方法
- MySQL的重装问题解决
- 关于项目经理/IT顾问的两则笑话
- HDU 2199
- About exception
- MySQL 5.6.9 RC 发布
- 实验三十四 Windows Server 2012 RDS桌面虚拟化之五VDI标准部署之非托管个人虚拟机
- char *c和char c[]区别
- Poj 2352 Stars
- cs8900在2.6.32.2上的移植
- kvc and kvo
- 美妙的模电2013/5/1
- linux下安装mysql