【問卷-英文學習功能需求】只要填寫就能獲得500Y,結束時間 2024/06/03 12:00。 前往查看

OJCP(SCJP)題庫下載題庫

上一題
Given: 1. public class Test{ 2. public static void main(String[] args){ 3. int x = 5; SCJP 6.0 認證教戰手冊 黃彬華著 碁峰出版 2 4. boolean b1 = true; 5. boolean b2 = false; 6. 7. if((x==4) && !b2) 8. System.out.print("1 "); 9. System.out.print("2 "); 10. if((b2=true) && b1) 11. System.out.print("3 "); 12. } 13. } What is the result?
(A) 2
(B) 3
(C) 1 2
(D) 2 3
(E) 1 2 3 F. Compilation fails. G. An exception is thrown at runtime.


答案:登入後觀看
難度: 適中
1F
Joe Chen (2016/02/20)
1. public class Test{
2. public static void main(String[] args){
3. int x = 5;
4. boolean b1 = true;
5. boolean b2 = false;
6.
7. if((x==4) && !b2)
8. System.out.print("1 ");
9. System.out.print("2 ");
10. if((b2=true) && b1)
11. System.out.print("3 ");
12. }
13. }

What is the result?

Given: 1. public class Test{ 2. public..-阿摩線上測驗