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.这道题的题面是什么,为什么选bce呢?

解决方案 »

  1.   

    因为 finally语句在正常情况下总会被执行!所以 只要你正常执行了try catch语句那么finally中的语句也就是37行就会被执行。
      

  2.   

    FINALLY里的语句 是  一旦 程序进入TRY语句中就必然执行 
    可以试试 要实践
      

  3.   

    finally只要程序中没有使用SYSTEM.EXIT()方法退出,都该得到执行;
      

  4.   

    A 被回收,自然不会执行到trycatch, D在进入try catch之前就出了异常,所以也执行不到try catch 自然就进入不了finally.当然也有一种例外 :try {
    System.exit(1);
    } catch (Exception e) {
    } finally {
    System.out.println("hello");
    }