阿摩線上測驗 登入

試題詳解

試卷:104年 - SCJP 151-200#99330 | 科目:OJCP(SCJP)

試卷資訊

試卷名稱:104年 - SCJP 151-200#99330

年份:104年

科目:OJCP(SCJP)

166. Given: 
1. public class BuildStuff{ 
2. public static void main(String[] args){ 
3. Boolean test = new Boolean(true); 
4. Integer x = 343; 
5. Integer y = new BuildStuff().go(test, x); 
6. System.out.println(y);
 7. } 
8. int go(Boolean b, int i){ 
9. if(b) return (i/7);
 10. return (i/49); 
11. } 
12. } 
What is the result?
(A) 7
(B) 49
(C) 343
(D) Compilation fails.
(E) An exception is thrown at runtime.
正確答案:登入後查看