Java异常处理
来源:互联网 发布:stm32f103tbu6编程 编辑:程序博客网 时间:2024/06/06 21:01
throws 关键字
package com.hotmail.henrytien;public class ExceptionTest { public static void tell(int i,int j) throws ArithmeticException{ int temp = 0; temp = i/j; System.out.println(temp); } public static void main(String[] args) { // TODO Auto-generated method stub try { tell(10,0); } catch (Exception e) { System.out.println(e); } }}
- 自定义异常
package com.hotmail.henrytien;class MyException extends Exception{ public MyException(String msg) { super(msg); }}public class ExceptionDemo { public static void main(String[] args) { try { throw new MyException("自定义异常"); } catch (MyException e) { System.out.println(e); } }}
0 0
- 【java】java异常处理
- java异常和异常处理
- Java 异常及异常处理
- java异常与异常处理
- Java异常处理-----自定义异常
- Java异常与异常处理
- java异常及异常处理
- Java 异常与异常处理
- Java异常与异常处理
- Java异常及异常处理
- Java异常处理--自定义异常
- JAVA异常之异常处理
- Java异常处理-----自行处理
- Java异常处理-----抛出处理
- Java异常处理-----抛出处理
- java异常处理
- java 异常处理分析
- java异常处理
- QT20 database values in QLineEdit or textbox if select combobox
- Thread详解12:InheritableThreadLocal的使用
- 视频播放器(四)——总结篇
- Block的深入研究之Block的内存管理
- 71. Simplify Path
- Java异常处理
- 有趣的数 算法的题解(数位DP问题)
- QT21 Display selected row from QTableView to QlineEdit
- [hdu5654 xiaoxin and his watermelon candy]区间内不同数的个数
- Client:TSocketConnection和Server:Scktsrvr关系----压缩数据传输
- 历代C++标准整理
- QT22 database values in QLineEdit or textbox if select QListView
- K-Means聚类算法实现对路透社语料reuters聚类
- QT23 how to open a website in a default user browser