阿摩線上測驗 登入

申論題資訊

試卷:104年 - SCJP 51-100#99391
科目:OJCP(SCJP)
年份:104年
排序:0

申論題內容

66. Given: 
5. class Thingy{ Meter m = new Meter(); }
 6. class Component {void go() { System.out.print("c");}} 
7. class Meter extends Component {void go() { System.out.print("m"); }} 
8.
 9. class DeluxeThingy extends Thingy { 
10. public static void main(String[] args) { 
11. DeluxeThingy dt = new DeluxeThingy(); 
12. dt.m.go(); 
13. Thingy t = new DeluxeThingy(); 
14. t.m.go(); 
15. } 
16. } Which two are true? (Choose two.) (A) The output is mm. (B) The output is mc. (C) Component is-a Meter. (D) Component has-a Meter. (E) DeluxeThingy is-a Component. (F) DeluxeThingy has-a Component.