用戶【Joe Chen】點評問題和點評內容

【評論主題】Given:1. public class TestString1{2. public static void main(String[] args){3. String str = "42

【評論內容】Given:1. public class TestString1{2. public static void main(String[] args){3. String str = "420";4. str += 42;5. System.out.print(str);6. }7. }What is the output?(A) 42(B) 420(C) 462(D) 42042(E) Compilation fails.(F). An exception is thrown at runtime.

【評論主題】第5題Given:10. int x = 0;11. int y = 10;12. do{13. y--;14. ++x;15. }while(x < 5);16. System.out.pri

【評論內容】Given:10. int x = 0;11. int y = 10;12. do{13. y--;14. ++x;15. }while(x < 5);16. System.out.print(x + "," + y);What is the result?(A) 5,6(B) 5,5(C) 6,5(D) 6,6

【評論主題】Given:22. public void go(){23. String o = "";24. z:25. for(int x=0; x<3; x++){26. for(i

【評論內容】Given: 22. public void go(){ 23. String o = ""; 24. z: 25. for(int x=0; x<3; x++){ 26. for(int y=0; y<2; y++){ 27. if(x == 1) break; 28. if(x==2 && y==1) break z; 29. o = o + x + y; 30. } 31. } 32. System.out.println(o); 33. } What is the result when the go() method is invoked?(A) 00(B) 0001(C) 000120(D) 00012021(E) Compilation fails. F. An exception is thrown at runtime.

【評論主題】Given:1. public class Test{2. public static void main(String[] args){3. int x = 5;SCJP 6.0 認證教戰手冊 黃彬

【評論內容】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:35. String #name = "Jane Doe";36. int $age = 24;37. Double _height = 123.5;38. doubl

【評論內容】#: 符號無法當變數名稱~: 運算符號無法當變數名稱