没有合适的资源?快使用搜索试试~ 我知道了~
java scjp065认证复习资料
5星 · 超过95%的资源 需积分: 3 7 下载量 126 浏览量
2011-06-08
23:22:17
上传
评论
收藏 1.04MB PDF 举报
温馨提示
试读
133页
报考scjp065的 看这个就行了 两天 九十一分 个人经历
资源推荐
资源详情
资源评论
SCJP 6.0 認證教戰手冊 黃彬華著 碁峰出版
1
書名:SCJP 6.0 認證教戰手冊 作者:黃彬華
完全擬真試題 1-100(共 244 題)
第1題
Given:
35. String #name = "Jane Doe";
36. int $age = 24;
37. Double _height = 123.5;
38. double ~temp = 37.5;
Which two statements are true? (Choose two.)
A. Line 35 will not compile.
B. Line 36 will not compile.
C. Line 37 will not compile.
D. Line 38 will not compile.
答案:AD
參考:2-4 Java 程式內容簡介
第2題
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.
答案:D
參考:3-3 文字串接符號
第3題
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.
答案:D
參考:4-1 條件控制
第4題
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. 00012
0
D. 00012021
E. Compilation fails.
F. An exception is thrown at runtime.
答案:C
參考:4-3 特殊流程的處理
SCJP 6.0 認證教戰手冊 黃彬華著 碁峰出版
3
第5題
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
答案:B
參考:4-2 迴圈控制
第6題
Given:
1. public class Breaker{
2. static String o = "";
3. public static void main(String[] args){
4. z:
5. o = o + 2;
6. for(int x=3; x<8; x++){
7. if(x == 4) break;
8. if(x == 6) break z;
9. o = o + x;
10. }
11. System.out.println(o);
12. }
13. }
What is the result?
A. 23
B. 234
C. 235
D. 2345
E. 2357
F. 23457
G. Co
mpilation fails.
答案:G
參考:4-3 特殊流程的處理
第7題
SCJP 6.0 認證教戰手冊 黃彬華著 碁峰出版
4
Given:
1. public class Breaker2{
2. static String o = "";
3. public static void main(String[] args){
4. z:
5. for(int x=2; x<7; x++){
6. if(x == 3) continue;
7. if(x == 5) break z;
8. o = o + x;
9. }
10. System.out.println(o);
11. }
12. }
What is the result?
A. 2
B. 24
C. 234
D. 246
E. 2346
F. Compilation fails.
答案:B
參考:4-3 特殊流程的處理
第8題
Given:
1. public class Spock{
2. public static void main(String[] args){
3. Long tail = 2000L;
4. Long distance = 1999L;
5. Long story = 1000L;
6. if((tail>distance) ^ ((story*2)==tail))
7. System.out.print("1");
8. if((distance+1 != tail) ^ ((story*2)==distance))
9. System.out.print("2");
10. }
11. }
What is the result?
A. 1
B. 2
C. 12
D. Co
mpilation fails.
E. No output is produced.
F. An exception is thrown at runtime.
答案:E
參考:4-1 條件控制
Operator ^ : if both conditions are different, true.
SCJP 6.0 認證教戰手冊 黃彬華著 碁峰出版
5
第9題
Given:
11. String[] elements = {"for", "tea", "too"};
12. String first = (elements.length>0) ? elements[0] : null;
What is the result?
A. Compilation fails.
B. An exception is thrown at runtime.
C. The variable first is set to null.
D. The variable first is set to elements[0].
答案:D
參考:4-1 條件控制、5-2 1 維陣列介紹
第10題
Given:
1. import java.util.*;
2. public class Quest{
3. public static void main(String[] args){
4. String[] colors =
5. {"blue","red","green","yellow","orange"};
6. Arrays.sort(colors);
7. int s2 = Arrays.binarySearch(colors, "orange");
8. int s3 = Arrays.binarySearch(colors, "violet");
9. System.out.print(s2 + "" + s3);
10. }
11. }
What is the result?
A. 2-1
B. 2-4
C. 2-5
D. 3-1
E. 3-4
F. 3-5
G. Compilation fails.
H. An exception is thrown at runtime.
答案:C
參考:5-4 1 維陣列的排序與搜尋
第11題
Given:
1. class Alligator{
2. public static void main(String[] args){
3. int[]x[] = {{1,2},{3,4,5},{6,7,8,9}};
剩余132页未读,继续阅读
资源评论
- q8641975322013-08-07好吧,开发转测试,这证就没去考了 不过还是感谢楼主分享
MC.Chen-S
- 粉丝: 3
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功