异常捕捉
public class CatchWho {
public static void main(String[] args) {
try {
try {
throw new ArrayIndexOutOfBoundsException();
}
catch(ArrayIndexOutOfBoundsException e) {
System.out.println( "ArrayIndexOutOfBoundsException" + "/�ڲ�try-catch");
}
throw new ArithmeticException();
}
catch(ArithmeticException e) {
System.out.println("����ArithmeticException");
}
catch(ArrayIndexOutOfBoundsException e) {
System.out.println( "ArrayIndexOutOfBoundsException" + "/���try-catch");
}
}
}
public class CatchWho2 {标签:ArrayIndexOutOfBoundsException,ArithmeticException,System,try,catch,10.17,out From: https://www.cnblogs.com/guozi6/p/17964372
public static void main(String[] args) {
try {
try {
throw new ArrayIndexOutOfBoundsException();
}
catch(ArithmeticException e) {
System.out.println( "ArrayIndexOutOfBoundsException" + "/�ڲ�try-catch");
}
throw new ArithmeticException();
}
catch(ArithmeticException e) {
System.out.println("����ArithmeticException");
}
catch(ArrayIndexOutOfBoundsException e) {
System.out.println( "ArrayIndexOutOfBoundsException" + "/���try-catch");
}
}
}