public class TestDemo09
{
public static void main(String[] args){
try{
int a=1/0;
int[] b={1,2};
b[4]=4;
}
catch(ArithmeticException e){
System.out.print("rrr");
}
catch(ArrayIndexOutOfBoundsException e){
System.out.print("vvv");
}finally{
System.out.print("sss");
}}
}
//大家帮帮忙异常关系
而且也会抛出ArithmeticException异常
只不过有个先后问题,比如你先抛出ArithmeticException异常了,那么下一步就直接跳fianlly了。
而没有运行
catch(ArrayIndexOutOfBoundsException e){
System.out.print("vvv");
}这个