首页 > 试题广场 >

下面 Java 代码的运行结果为() public clas

[单选题]
下面 Java 代码的运行结果为()
public class Test {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4};
        try {
            System.out.println(arr[5]);
        } catch (ArrayIndexOutOfBoundsException e) {
            System.out.println("catch");
            try {
                throw new MyException("exception");
            } catch (MyException me) {
                System.out.println(me.getMessage());
            }
        } finally {
            System.out.println("finally");
        }
    }
}
  • finally
  • catch
    finally
  • catch
    exception
    finally
  • 运行错误

这道题你会答吗?花几分钟告诉大家答案吧!