black

SCJP程序员认证考试

登录

单项选择题

1. public interface A { 
2. public void doSomething(String thing); 
3. } 
1. public class AImpl implements A { 
2. public void doSomething(String msg) { } 
3. } 
1. public class B { 
2. public A doit() { 
3. // more code here 
4. } 
5. 
6. public String execute() {
7. // more code here 
8. } 
9. } 
1. public class C extends B { 
2. public AImpl doit() {
 3. // more code here 
4. } 
5. 
6. public Object execute() { 
7. // more code here 
8. } 
9. } 
Which statement is true about the classes and interfaces in the exhibit?() 

A. Compilation will succeed for all classes and interfaces.
B. Compilation of class C will fail because of an error in line 2.
C. Compilation of class C will fail because of an error in line 6.
D. Compilation of class AImpl will fail because of an error in line 2.

相关考题

多项选择题 class One {  void foo() {}  }  class Two extends One {   //insert method here  }  Which three methods, inserted individually at line 14, will correctly complete class Two?()

多项选择题 class One {   public One foo() { return this; }  }  class Two extends One {  public One foo() { return this; }  }  class Three extends Two {   // insert method here  }  Which two methods, inserted individually, correctly complete the Three class?()

多项选择题 A JavaBeans component has the following field:  11. private boolean enabled;  Which two pairs of method declarations follow the JavaBeans standard for accessing this field?()

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3