black

SCJP程序员认证考试

登录

单项选择题

11. public class Test { 
12. public void foo() { 
13. assert false; 
14. assert false; 
15. } 
16. public void bar(){ 
17. while(true){ 
18. assert false; 
19. } 
20. assert false; 
21. } 
22. } 
What causes compilation to fail?()  

A. Line 13
B. Line 14
C. Line 18
D. Line 20

相关考题

单项选择题 interface Beta {}  class Alpha implements Beta {  String testIt() {  return “Tested”;  }  }  public class Main1 {  static Beta getIt() {  return new Alpha();  }  public static void main( String[] args ) {  Beta b = getIt();  System.out.println( b.testIt() );  }  }  What is the result?()

单项选择题 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?()

单项选择题 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?()

All Rights Reserved 版权所有©求知题库网库(csqiuzhi.com)

备案号:湘ICP备14005140号-1

经营许可证号:湘B2-20140064