black

SCJP程序员认证考试

登录

单项选择题

1. public class GoTest { 
2. public static void main(String[] args) { 
3. Sente a = new Sente(); a.go(); 
4. Goban b = new Goban(); b.go(); 
5. Stone c = new Stone(); c.go(); 
6. } 
7. }
8. 
9. class Sente implements Go { 
10. public void go() { System.out.println(”go in Sente.”); } 
11. } 
12. 
13. class Goban extends Sente { 
14. public void go() { System.out.println(”go in Goban”); } 
15. } 
16. 
17. class Stone extends Goban implements Go { } 
18. 
19. interface Go { public void go(); } 
What is the result?() 

A. go in Goban     go in Sente go in Sente
B. go in Sente      go in Sente go in Goban
C. go in Sente     go in Goban go in Goban
D. go in Goban    go in Goban go in Sente
E. Compilation fails because of an error in line 17.

相关考题

多项选择题 public abstract class Shape {  private int x;  private int y;  public abstract void draw();  public void setAnchor(int x, int y) {  this.x = x;  this.y = y;  }  }  Which two classes use the Shape class correctly?()

单项选择题 interface Data { public void load(); }  abstract class Info { public abstract void load(); }  Which class correctly uses the Data interface and Info class?()

多项选择题 10. abstract public class Employee {  11. protected abstract double getSalesAmount();  12. public double getCommision() {  13. return getSalesAmount() * 0.15;  14. }  15. }  16. class Sales extends Employee {  17. // insert method here  18. }  Which two methods, inserted independently at line 17, correctly complete the Sales class?()

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

备案号:湘ICP备2022003000号-3