异常链,异常嵌套
来源:互联网 发布:清朝留辫子原因 知乎 编辑:程序博客网 时间:2024/06/05 16:24
public class Fu {
public static void main(String[] args) {
Mei m=new Mei();
try {
m.vivo(1,0);
} catch (Le e) {
e.printStackTrace();
System.out.println("原因->"+e);
}
}
}
class Mei{
public void vivo(int a,int b) throws Le{
if(b==0){
Le e=new Le("3456789");
Xi e1=new Xi("odijuhgfjk");
e.initCause(e1);
throw e;
}
}
}
public class Le extends Exception{
public Le(String message) {
super(message);
}
}
public class Xi extends Exception{
public Xi(String message) {
super(message);
}
}
阅读全文
0 0
- 异常链,异常嵌套
- 异常捕获嵌套
- C++ 嵌套异常
- 数据库嵌套异常
- xml格式异常-CDATA嵌套
- xml格式异常-CDATA嵌套
- xml格式异常-CDATA嵌套
- Java 异常 异常链
- NT 中的异常帧结构和异常嵌套
- db2嵌套过程异常处理与java异常处理
- NT 中的异常帧结构和异常嵌套
- 异常
- 异常!
- 异常
- 异常
- 异常
- 异常
- 异常
- Android自定义View的事件分发机制(三)
- notes
- buf_flush_page_cleaner_thread
- HTML基础总结
- HDU5122-对冒泡的理解||BIT
- 异常链,异常嵌套
- std::bind
- eclipse.exe启动的时候,为什么需要指定jre?或者说,如果没有jre,为什么eclipse.exe就运行不起来,或者报错?
- [转载]使用SSH公钥实现免密码登录
- CSS基础
- 从零学习搭建邮件系统
- ural 1028. Stars 树状数组
- Mysql5.6版本导出sql文件数据导入到5.7版本出现的问题
- SQL与PLSQL的对比