?? mulcatchtest.java
字號:
public class MulCatchTest{
public static void main(String []args){
int a[]=new int[2];
// int a[]=new int[1] ;
int n=a.length;
int x;
a[0]=10;
try{
for(int i=0;i<=n;i++){
x=100/a[i];
System.out.println("100/a["+i+"]="+x);
}
}catch(ArithmeticException e){
System.out.println("Divided by zero!");
}catch(ArrayIndexOutOfBoundsException e){
System.out.println("Array Index Out Of Bounds Exception!");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -