Click the Exhibit button. What is the output of the program shown in the exhibit? ()
A. 300-300-100-100-100 B. 300-300-300-100-100 C. 300-300-300-300-100 D. 300-100-100-100-100
单项选择题Given: What is the result?()
A. If you define D e = new E(), then e.bMethod() invokes the version of bMethod() defined in Line 5. B. If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 5. C. Compilation fails because of an error in line 9. D. If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9. E. Compilation fails because of an error in line 3. F. Compilation fails because of an error in line 7.
单项选择题Given: 11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println( B ); } 16. } 17. public static void main(String[] args) { 18. A a = new B(); 19. a.process(); 20. } What is the result? ()
A. Compilation fails because of an error in line 19. B. An exception is thrown at runtime. C. B D. Compilation fails because of an error in line 18. E. Compilation fails because of an error in line 15. F. The code runs with no output.
单项选择题Given: 12. System.out.format( Pi is approximately %d. , Math.PI); What is the result?()
A. An exception is thrown at runtime. B. Pi is approximately 3. C. Pi is approximately 3.141593. D. Compilation fails.
单项选择题Given: 11. String test = This is a test ; 12. String[] tokens = test.split( s ); 13. System.out.println(tokens.length); What is the result?()
A. An exception is thrown at runtime. B. 1 C. 4 D. Compilation fails. E. 0
单项选择题Given: 11. public void genNumbers() { 12. ArrayList numbers = new ArrayList(); 13. for (int i=0; i<10; i++) { 14. int value = i * ((int) Math.random()); 15. Integer intObj = new Integer(value); 16. numbers.add(intObj); 17. } 18. System.out.println(numbers); 19. } Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?()
A. Line 19 B. The object is NOT a candidate for garbage collection. C. Line 17 D. Line 16 E. Line 18