- 18
- 0
- 约2.4万字
- 约 24页
- 2017-05-26 发布于河南
- 举报
OCJP认证解析3
Exam : 1Z0-851Java Standard Edition 6?Programmer Certified?Professional Exam
以下分析全都是我自己分析或者参考网上的,定有疏漏,还请大家对我的分析提出质疑。
QUESTION 61Given: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. 42B. 420C. 462D. 42042E. Compilation fails.F. An exception is thrown at runtime.Answer: D
42会自动类型转换成String类型。
QUESTION 62Given:12. Date date = new Date();13. df.setLocale(Locale.ITALY);14. String s = df.format(date);The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if thiscode is run on December 14, 2000?A. The value of s is 14-dic-2000.B. The value of s is Dec 14, 2000.C. An exception is thrown at runtime.D. Compilation fails because of an error in line 13.Answer: D
设置地点不是这样设置,如下:
Locale.setDefault(Locale.US);//设置为美国地区??
QUESTION 63
Given:1. public class KungFu {2. public static void main(String[] args) {3. Integer x = 400;4. Integer y = x;5. x++;6. StringBuilder sb1 = new StringBuilder(123);7. StringBuilder sb2 = sb1;8. sb1.append(5);9. System.out.println((x==y) + + (sb1==sb2));10. }11. }What is the result?A. true trueB. false trueC. true falseD. false falseE. Compilation fails.F. An exception is thrown at runtime.Answer: B
x与y引用相同的对象400,但是x++即x = x + 1; 使x引用401,而y依然引用400,输出false。
QUESTION 64Given that the current directory is empty, and that the user has read and write privileges to the currentdirectory, and the following:1. import java.io.*;2. public class Maker {3. public static void main(String[] args) {4. File dir = new File(dir);5. File f = new File(dir, f);6. }7. }Which statement is true?A. Compilation fails.B. Nothing is added to the file system.C. Only a new file is created on the file system.D. Only a new directory is created on the file system.E. Both a new file and a new directory are created on the file system.
Answer: B
没调用creat函数,不会是文件系统
您可能关注的文档
- 【名词性从句.doc
- _名词性从句.doc
- Unit 3 整体课件.ppt
- 实验一 :WindowsThreads多线程编程.doc
- 名词性从句 主谓一致.doc
- 14版英语人教版教材解读必修4unit 5.doc
- Essay专用连接词大全.docx
- 实验2:线程与同步(解答).doc
- 美国文学史试题库.doc
- 面向对像编程.doc
- 配送服装信息保护协议.docx
- 2025年上海立达学院单招综合素质考试试题及答案解析.docx
- 2025年上海第二工业大学单招综合素质考试试题及答案解析.docx
- 2025年上饶幼儿师范高等专科学校单招综合素质考试题库及答案解析.docx
- 2026年全民冬季防寒保暖必知技能知识考试题(附答案).pdf
- 2025年上饶幼儿师范高等专科学校单招职业技能考试题库及答案解析.docx
- 2025年上海第二工业大学单招职业适应性测试题库及答案解析.docx
- 2025年上饶幼儿师范高等专科学校单招职业适应性测试试题及答案解析.docx
- 2025年上海海洋大学单招职业适应性测试试题及答案解析.docx
- 2025至2030中国天然饲料添加微量矿物质行业细分市场及应用领域与趋势展望研究报告.docx
最近下载
- 明代宗教信仰与思想控制.docx VIP
- 江苏省南通市2024-2025学年高二上学期期末学业质量监测语文试卷(含答案).pdf VIP
- 国就有成人演出的电影了?想看就要冒生命危险.pdf VIP
- 综合素质练习题及答案.doc VIP
- 2020-2021学年北京高三化学二轮复习 反应原理型简答题(突破二卷)(word版 含答案).docx VIP
- 电力拖动控制线路安装与检修(白银矿冶职业技术学院)知到智慧树答案.docx VIP
- 煤炭巷道掘砌工(高级工)资格考试题库(全真题库).docx VIP
- 影像叙事中情感共鸣生成机制.docx VIP
- 同轴二级圆柱齿轮减速器的设计(硬齿面).doc VIP
- 基于GPU多线程多通道图像高速重构方法、设备及介质.pdf VIP
原创力文档

文档评论(0)