📄 chap7-7.txt
字号:
// 程序7-7
public class testException{
static void Test( ) throws userException{
userException e;
e=new userException("自定义异常" );
throw e; // 自定义异常必须采用throw语句抛出
}
public static void main(String args[ ]) {
try{
Test( );
}catch(userException e) { // 捕捉异常
System.out.println(e.show( ));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -