📄 unreachablecode.java
字号:
class exceptioncode{
exceptioncode(){
}
public void calculate(){
try{
int num=0;
int num1=42/num;
}catch(Exception e){
System.out.println("父类异常CATCH子句");
}catch(ArithmeticException ae){//错误-不能到达的代码
System.out.println("这个子类的父类是"+
"exception 类,且不能到达");
}
}
}
public class unreachablecode{
protected unreachablecode(){
}
public static void main(String[] args){
exceptioncode obj1=new exceptioncode();
obj1.calculate();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -