• <rt id="aqsio"></rt>

        聯(lián)系客服微信掃一掃關(guān)注公眾號(hào)后聯(lián)系客服
        掃碼練習(xí)微信掃碼免費(fèi)搜題
        • 首頁(yè)

        • 題庫(kù)

        • 網(wǎng)課

        • 在線???/h3>

        • 桌面端

        登錄
        • 搜標(biāo)題
        • 搜題干
        • 搜選項(xiàng)
        單項(xiàng)選擇題

        1. class Bar { } 
        1. class Test { 
        2. Bar doBar() { 
        3. Bar b = new Bar(); 
        4. return b; 
        5. } 
        6. public static void main (String args[]) { 
        7. Test t = new Test(); 
        8. Bar newBar = t.doBar(); 
        9. System.out.println(“newBar”); 
        10. newBar = new Bar(); 
        11. System.out.println(“finishing”); 
        12. } 
        13. }
        At what point is the Bar object, created on line 3, eligible for garbage collection?()  

        A. After line 8.
        B. After line 10.
        C. After line 4, when doBar() completes.
        D. After line 11, when main() completes.

        題目列表

        你可能感興趣的試題

        • 單項(xiàng)選擇題

          1. public class A { 
          2. void A() { 
          3. System.out.println(“Class A”); 
          4. } 
          5. public static void main(String[] args) { 
          6. new A(); 
          7. } 
          8. } 
          What is the result?()  

          A. Class A
          B. Compilation fails.
          C. An exception is thrown at line 2.
          D. An exception is thrown at line 6.
          E. The code executes with no output.

        • 單項(xiàng)選擇題

          20. public float getSalary(Employee e) { 
          21. assert validEmployee(e); 
          22. float sal = lookupSalary(e); 
          23. assert (sal>0); 
          24. return sal; 
          25. } 
          26. private int getAge(Employee e) { 
          27. assert validEmployee(e); 
          28. int age = lookupAge(e); 
          29. assert (age>0); 
          30. return age; 
          31. } 
          Which line is a violation of appropriate use of the assertion mechanism?()  

          A. line 21
          B. line 23
          C. line 27
          D. line 29

        掃碼聯(lián)系掃碼聯(lián)系在線客服
        反饋使用問(wèn)題
        掃碼練習(xí)掃碼使用找答案小程序
        手機(jī)搜題/刷題/上網(wǎng)課

        版權(quán)所有?考試資料網(wǎng)(ppkao.com) 長(zhǎng)沙求知信息技術(shù)有限公司 All Rights Reserved

        湘公網(wǎng)安備 43010202000353號(hào)備案號(hào): 湘ICP備14005140號(hào)-2

        經(jīng)營(yíng)許可證號(hào) : 湘B2-20140064

        • 聯(lián)系客服
        • 小程序
        • 桌面端下載
        • 回到頂部

        感谢您访问我们的网站,您可能还对以下资源感兴趣:

        国产黄色视屏