📄 throwexception3.java
字号:
public class ThrowException3{
int x;
void throw1()throws ArithmeticException{
x=0;
x=3/x;
x=1;
System.out.println("x="+x);
}
public static void main(String[] args){
ThrowException3 c=new ThrowException3();
try{
c.throw1();
}catch(Exception e){
System.out.println("begin to catch exception");
System.out.println("get message="+e.getMessage());
}
System.out.println("program ends ok");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -