black

SCJP程序员认证考试

登录

单项选择题

1. class A { 
2. public String toString ()  { 
3. return “4”; 
4. } 
5. } 
6. class B extends A { 
7. public String toString ()   { 
8. return super.toString()  + “3”; 
9. } 
10. } 
11. public class Test { 
12.   public static void main(String[]args)  { 
13.      System.out.printIn(new B()); 
14.      } 
15. }   
What is the result?()  

A. Compilation succeeds and 4 is printed.
B. Compilation succeeds and 43 is printed.
C. An error on line 9 causes compilation to fail.
D. An error on line 14 causes compilation to fail.
E. Compilation succeeds but an exception is thrown at line 9.

相关考题

多项选择题 Whichtwodemonstrateencapsulationofdata?()

单项选择题 public class Test {  public static void main (String [] args)  {  string foo = “blue”;  string bar = foo;  foo = “green”;  System.out.printIn(bar);  }  }   What is the result?()

单项选择题 2. public class Foo implements Runnable (  3. public void run (Thread t) {  4. system.out.printIn(“Running.”);  5. }  6. public static void main (String[] args)  {  7. new thread (new Foo()).start(); 8. )  9. )   What is the result?()

All Rights Reserved 版权所有©建筑考试题库(jzkao.com)

备案号:湘ICP备2020024380号-3