阿摩線上測驗 登入

試題詳解

試卷:104年 - SCJP 51-100#99391 | 科目:OJCP(SCJP)

試卷資訊

試卷名稱:104年 - SCJP 51-100#99391

年份:104年

科目:OJCP(SCJP)

62. Given: 
31. class Foo{ 
32. public int a = 3; 
33. public void addFive(){ a += 5; System.out.print("f "); } 
34. } 
35. class Bar extends Foo{ 
36. public int a = 8; 
37. public void addFive(){this.a += 5; System.out.print("b ");} 
38. }
Invoked with: 
Foo f = new Bar(); 
f.addFive();
 System.out.println(f. a); 
What is the result?
(A) b 3
(B) b 8
(C) b 13
(D) f 3
(E) f 8
正確答案:登入後查看