📄 arithmeticexception.java
字号:
class exceptionraised{
protected exceptionraised(){
}
static int calculate(int operand1,int operand2){
int result=operand1/operand2;
return result;
}
}
public class ArithmeticException{
protected ArithmeticException(){
}
public static void main(String[] s){
exceptionraised obj=new exceptionraised();
try{
int result =obj.calculate(9,0);
System.out.println(result);
}
catch(Exception e){
System.err.println("发生异常:"+e.toString());
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -