//package Exception_test1;
public class Exception_test {
public static void main(String[] args) {
int[] a = {10, 20, 30, 40, 50};
int[] b = {0, 2, 30};
int[] c = new int[5];
for (int i = 0; i < 5; i++) {
try {
c[i] = a[i] / b[i];
} catch (ArithmeticException e) {
System.out.println("0不能做为除数!");
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("数组下标越界!");
}
}
System.out.println("结束");
}
}



