4. Given: 
31. // some code here 
32. try { 
33. // some code here 
34. } catch (SomeException se) { 
35. // some code here 
36. } finally { 
37. // some code here 
38. } 
Under which three circumstances(情况)will the code on line 37 be executed? (Choose three.) A. The instance(实例) gets garbage(垃圾) collected(收集)。 
B. The code on line 33 throws an exception. 
C. The code on line 35 throws an exception. 
D. The code on line 31 throws an exception. 
E. The code on line 33 executes successfully. 
我想问下  那个若是31行 有异常  程序是怎么处理的  还会在执行try catch么

解决方案 »

  1.   

    public static void main(String[] args) {
            String a = null;
            a.getBytes();
            try {
                throw new RuntimeException("2");
            } finally {
                System.out.println("3");
            }
        }
    输出:Exception in thread "main" java.lang.NullPointerException
    at test.ww.TestFinally.main(TestFinally.java:19)其实有时候自己测试一下就什么都明白了
    不用着急问
      

  2.   

    31行 有异常 不会在执行try catch异常没有捕获
      

  3.   

    31行出异常,如果没有try..catch,程序就停止往下运行
      

  4.   

    31行 有异常 不会在执行try catch异常没有捕获
      

  5.   

    31行的異常并不在try catch之內,所以異常不能捕獲,異常finally不執行。
      

  6.   

    1.异常不在try里面 怎么捕获...
    2.如果执行到try里面语句,是否有异常 都必须执行finally的
      

  7.   

    如果执行到try里面语句,是否有异常 都必须执行finally的
      

  8.   

    C.在catch当中产生了异常,会发生什么情况,求解
      

  9.   

    一样会执行finally,只不过finally下面的就不会执行了
      

  10.   

    如果有了异常,catch,finally都会执行的。
      

  11.   

    只要进入了try catch 块就会执行~
      

  12.   

    31行,不在try里面,会向上抛出.后面不会在执行了.
      

  13.   

    finally 始终都会执行,它是用来释放资源的