阿摩線上測驗 登入

試題詳解

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

試卷資訊

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

年份:104年

科目:OJCP(SCJP)

100. Given:
 10. public class SuperCalc{ 
11. protected static int multiply(int a, int b){return a * b;}
 12. }
 and: 
20. public class SubCalc extends SuperCalc{
 21. public static int multiply(int a, int b){ 
22. int c = super.multiply(a, b);
 23. return c;
 24. } 
25. } 
and: 
30. SubCalc sc = new SubCalc();
 31. System.out.println(sc.multiply(3, 4)); 
32. System.out.println(SubCalc.multiply(2, 2));
 What is the result?
(A) 12 4
(B) The code runs with no output.
(C) An exception is thrown at runtime.
(D) Compilation fails because of an error in line 21.
(E) Compilation fails because of an error in line 22.
正確答案:登入後查看