📄 somecatch_2.java
字号:
package com.servern.java;
public class SomeCatch_2 {
int i = 5 ;
int j = 0 ;
private double devide(int a ,int b){
return a/b ;
}
public static void main(String []args){
SomeCatch_2 s = new SomeCatch_2();
try
{
double result = s.devide(s.i, s.j);
System.out.println("the result is " + result);
}
catch (ArithmeticException e)
{
System.out.println("the program is running into ArithmeticException");
System.out.println(e.getMessage());
}
catch (Exception e)
{
System.out.println("the program is running into other unknowed Exception");
System.out.println(e.getMessage());
}
System.out.println("the program is running here, that is normal!");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -