- 1、本文档共24页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
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
- 四川省德阳市罗江中学2025届高三考前热身化学试卷含解析.doc
- 山东省枣庄现代实验学校2025届高三下学期第五次调研考试化学试题含解析.doc
- 吉林省长春市十一高中等九校教育联盟2025届高三一诊考试生物试卷含解析.doc
- 2025届江苏省盐城市伍佑中学高考仿真模拟化学试卷含解析.doc
- 2025届广西贺州中学高考冲刺押题(最后一卷)生物试卷含解析.doc
- 安徽省池州市贵池区2025届高三第一次模拟考试生物试卷含解析.doc
- 宁夏银川一中2025届高三(最后冲刺)化学试卷含解析.doc
- 广东省广州市增城区四校联考2025届高考压轴卷化学试卷含解析.doc
- 2025届邯郸市第一中学高考生物必刷试卷含解析.doc
- 2025届安徽省安庆市石化第一中学高考仿真卷化学试卷含解析.doc
文档评论(0)