black

SCJP程序员认证考试

登录

多项选择题

Assume that country is set for each class. 
Given: 
10. public class Money { 
11. private String country, name; 
12. public getCountry() { return country; } 
13.} 
and: 
24. class Yen extends Money { 
25. public String getCountry() { return super.country; } 
26. } 
27. 
28. class Euro extends Money { 
29. public String getCountry(String timeZone) { 
30. return super.getCountry(); 
31. } 
32. } 
Which two are correct?()

A. Yen returns correct values.
B. Euro returns correct values.
C. An exception is thrown at runtime.
D. Yen and Euro both return correct values.
E. Compilation fails because of an error at line 25.
F. Compilation fails because of an error at line 30.

相关考题

单项选择题 public class CreditCard {  private String cardlD;  private Integer limit;  public String ownerName;  public void setCardlnformation(String cardlD,  String ownerName, 28. Integer limit) {  this.cardlD = cardlD;  this.ownerName = ownerName;  this.limit = limit;  }  } Which is true?()

单项选择题 10. interface Foo {}  11. class Alpha implements Foo {}  12. class Beta extends Alpha {}  13. class Delta extends Beta {  14. public static void main( String[] args) {  15. Beta x = new Beta();  16. // insert code here  17. }  18. }  Which code, inserted at line 16, will cause a java.lang.ClassCastException?()

多项选择题 31. // some code here  32. try {  33. // some code here  34. } catch (SomeException se) {  35. // some code here  36. } finally {  37. // some code here  38. }  Under which three circumstances will the code on line 37 be executed?()

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

备案号:湘ICP备2022003000号-3