阿摩線上測驗 登入

試題詳解

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

試卷資訊

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

年份:104年

科目:OJCP(SCJP)

90. Given:
 11. interface DeclareStuff{ 
12. public static final int EASY = 3; 
13. void doStuff(int t);}
 14. public class TestDeclare implements DeclareStuff{
 15. public static void main(String[] args){ 
16. int x = 5;
 17. new TestDeclare().doStuff(++x); 
18. }
 19. void doStuff(int s){ 
20. s += EASY + ++s; 
21. System.out.println("s " + s); 
22. }
 23. }
 What is the result?
(A) s 14
(B) s 16
(C) s 10
(D) Compilation fails.
(E) An exception is thrown at runtime.
正確答案:登入後查看