📄 throwsexception.java~8~
字号:
package ThrowsException;public class ThrowsException { static void proc(int sel)throws ArithmeticException,ArrayIndexOutOfBoundsException{ System.out.println("-------in "+sel+"--------"); if(sel==0){ System.out.println("no Exception caught"); return; } else if(sel==1){ int A[]=new int[2]; A[10]=3; } else if(sel==2){ int i=0; int j=4/i; } } public static void main(String args[]){ try{ proc(0); proc(2); proc(1); } catch(ArrayIndexOutOfBoundsException e){ System.out.println("Catch "+e); } catch(ArithmeticException e){ System.out.println("catch "+e); } finally{ System.out.println("in proc finally"); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -