欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > 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.

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题