KillTest 质量更高 服务更好 学习资料 半年免费更新服务

Similar documents
KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

新・解きながら学ぶJava

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

3.1 num = 3 ch = 'C' 2

Chapter 9: Objects and Classes

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入

Microsoft PowerPoint - ch6 [相容模式]

Microsoft Word - 第3章.doc

Microsoft Word - ch04三校.doc

Chapter 9: Objects and Classes

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

EJB-Programming-4-cn.doc

Microsoft Word - 01.DOC

C/C++ - 字符输入输出和字符确认

untitled

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

Learning Java

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc


chp6.ppt

EJB-Programming-3.PDF

《大话设计模式》第一章

Microsoft Word - JAVA Programming Language Homework VI_ans.doc

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit

untitled

Java

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

2009年3月全国计算机等级考试二级Java语言程序设计笔试试题

untitled

untitled

D C 93 2

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

Java 1 Java String Date

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

WWW PHP

時 間 : 180 分 鐘 四 考 試 特 點 (a) 程 式 易 懂 撰 寫 簡 單, 不 必 經 過 長 時 間 的 課 程 訓 練 (b) 物 件 導 向 的 程 式 設 計, 將 重 點 擺 在 資 料 介 面 的 技 巧 (c)java 有 一 個 很 完 善 且 分 散 式 的 程 式

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii

内 容 简 介 本 书 是 一 本 关 于 语 言 程 序 设 计 的 教 材, 涵 盖 了 语 言 的 基 本 语 法 和 编 程 技 术, 其 中 包 含 了 作 者 对 语 言 多 年 开 发 经 验 的 总 结, 目 的 是 让 初 学 的 读 者 感 受 到 语 言 的 魅 力, 并 掌

A Preliminary Implementation of Linux Kernel Virus and Process Hiding

untitled

JBuilder Weblogic

Microsoft Word - 物件導向編程精要.doc

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数

untitled

OOP with Java 通知 Project 4: 5 月 2 日晚 9 点

(Microsoft Word - \272\364\263q\245|\244A_ _\304\254\253\330\336\263__\272\353\302\262\263\370\247i.doc)

RunPC2_.doc

提纲 1 2 OS Examples for 3

Microsoft PowerPoint - L17_Inheritance_v4.pptx

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO

内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指

JavaIO.PDF

02

untitled

2/80 2

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款

mvc

2 Java 语 言 程 序 设 计 教 程 简 单 性 Java 语 言 的 语 法 与 C 语 言 和 C++ 语 言 很 接 近, 使 得 大 多 数 程 序 员 很 容 易 学 习 和 使 用 Java 另 一 方 面,Java 丢 弃 了 C++ 中 很 少 使 用 的 很 难

Swing-02.pdf

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP: ******************* * 关于 Java 测试试题 ******

OOP with Java 通知 Project 4: 4 月 19 日晚 9 点

javaexample-02.pdf

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

FileMaker 16 ODBC 和 JDBC 指南

Outline USB Application Requirements Variable Definition Communications Code for VB Code for Keil C Practice

OOP with Java 通知 Project 3 提交时间 3 月 29 日晚 9 点 Piazza Project 2 投票

c_cpp

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B

基于CDIO一体化理念的课程教学大纲设计

C/C++程序设计 - 字符串与格式化输入/输出

Microsoft Word - ChineseSATII .doc

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream Class java.io.datainptstream (extends) FilterInputStream InputStream Obj

09 (File Processes) (mkdir) 9-3 (createnewfile) 9-4 (write) 9-5 (read) 9-6 (deletefile) 9-7 (deletedir) (Exercises)

用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應

untitled

2009年9月全国计算机等级考试二级Java真题及答案

2 WF 1 T I P WF WF WF WF WF WF WF WF 2.1 WF WF WF WF WF WF

1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6:

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class

Microsoft Word - 11.doc

OOP with Java 通知 Project 3: 3 月 29 日晚 9 点 4 月 1 日上课

(6) 要 求 付 款 管 理 员 从 预 订 表 中 查 询 距 预 订 的 会 议 时 间 两 周 内 的 预 定, 根 据 客 户 记 录 给 满 足 条 件 的 客 户 发 送 支 付 余 款 要 求 (7) 支 付 余 款 管 理 员 收 到 客 户 余 款 支 付 的 通 知 后, 检

无类继承.key

全国计算机技术与软件专业技术资格(水平)考试

untitled

untitled

附录J:Eclipse教程

untitled

Microsoft Word - Final Exam Review Packet.docx

Microsoft Word - 2CA13內文.doc

4.1 AMI MQSeries API AMI MQI AMI / / AMI JavaC C++ AMI / AMI AMI - / /

FileMaker 15 ODBC 和 JDBC 指南

java2d-4.PDF

Microsoft Word - Learn Objective-C.doc

Transcription:

KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务

Exam : 1Z0-854 Title : Java Standard Edition 5 Programmer Certified Professional Upgrade Exam Version : Demo 1 / 12

1.Given: 20. public class CreditCard { 21. 22. private String cardid; 23. private Integer limit; 24. public String ownername; 25. 26. public void setcardinformation(string cardid, 27. String ownername, 28. Integer limit) { 29. this.cardid = cardid; 30. this.ownername = ownername; 31. this.limit = limit; 32. } 33. } Which statement is true? A. The ownername variable breaks encapsulation. B. The class is fully encapsulated. C. The cardid and limit variables break polymorphism. D. The code demonstrates polymorphism. E. The setcardinformation method breaks encapsulation. Answer: A 2.DRAG DROP Click the Task button.? Answer: 2 / 12

3.DRAG DROP Click the Task button. Answer: 3 / 12

4.Which three statements concerning the use of the java.io.serializable interface are true? (Choose three.) A. Objects from classes that use aggregation cannot be serialized. B. The values in fields with the transient modifier will NOT survive serialization and deserialization. C. It is legal to serialize an object of a type that has a supertype that does NOT implement java.io.serializable. D. The values in fields with the volatile modifier will NOT survive serialization and deserialization. E. An object serialized on one JVM can be successfully deserialized on a different JVM. Answer: B,C,E 5.Which two code fragments will execute the method dostuff() in a separate thread? (Choose two.) A. new Thread() { public void start() { dostuff(); }}; B. new Thread() { public void run() { dostuff(); }}; C. new Thread(new Runnable() { public void run() { dostuff(); } }).start(); D. new Thread() { public void start() { dostuff(); } }.run(); E. new Thread(new Runnable() { public void run() { dostuff(); } }).run(); F. new Thread() { 4 / 12

public void run() { dostuff(); } }.start(); Answer: C,F 6.Given: 12. import java.io.*; 13. public class Forest implements Serializable { 14. private Tree tree = new Tree(); 15. public static void main(string [] args) { 16. Forest f = new Forest(); 17. try { 18. FileOutputStream fs = new FileOutputStream("Forest.ser"); 19. ObjectOutputStream os = new ObjectOutputStream(fs); 20. os.writeobject(f); os.close(); 21. } catch (Exception ex) { ex.printstacktrace(); } 22. } } 23. 24. class Tree { } What is the result? A. An exception is thrown at runtime. B. An instance of Forest is serialized. C. An instance of Forest and an instance of Tree are both serialized. D. Compilation fails. Answer: A 7.Given: 1. interface TestA { String tostring(); } 2. public class Test { 3. public static void main(string[] args) { 4. System.out.println(new TestA() { 5. public String tostring() { return "test"; } 6. }); 7. } 8. } What is the result? A. null B. An exception is thrown at runtime. C. Compilation fails because of an error in line 5. D. Compilation fails because of an error in line 4. E. Compilation fails because of an error in line 1. F. test Answer: F 8.DRAG DROP 5 / 12

Click the Task button. Answer: 9.Given: 1. public class Boxer1{ 2. Integer i; 3. int x; 4. public Boxer1(int y) { 6 / 12

5. x = i+y; 6. System.out.println(x); 7. } 8. public static void main(string[] args) { 9. new Boxer1(new Integer(4)); 10. } 11. } What is the result? A. Compilation fails because of an error in line 5. B. A NullPointerException occurs at runtime. C. Compilation fails because of an error in line 9. D. A NumberFormatException occurs at runtime. E. The value "4" is printed at the command line. F. An IllegalStateException occurs at runtime. Answer: B 10.Given: 10: public class Hello { 11: String title; 12: int value; 13: public Hello() { 14: title += " World"; 15: } 16: public Hello(int value) { 17: this.value = value; 18: title = "Hello"; 19: Hello(); 20: } 21: } and: 30: Hello c = new Hello(5); 31: System.out.println(c.title); What is the result? A. The code runs with no output. B. Hello C. Hello World 5 D. Compilation fails. E. An exception is thrown at runtime. F. Hello World Answer: D 11.Given: 10. class Line { 11. public class Point { public int x,y;} 7 / 12

12. public Point getpoint() { return new Point(); } 13. } 14. class Triangle { 15. public Triangle() { 16. // insert code here 17. } 18. } Which code, inserted at line 16, correctly retrieves a local instance of a Point object? A. Point p = (new Line()).getPoint(); B. Line.Point p = Line.getPoint(); C. Point p = Line.getPoint(); D. Line.Point p = (new Line()).getPoint(); Answer: D 12.Given: 11. // insert code here 12. private N min, max; 13. public N getmin() { return min; } 14. public N getmax() { return max; } 15. public void add(n added) { 16. if (min == null added.doublevalue() < min.doublevalue()) 17. min = added; 18. if (max == null added.doublevalue() > max.doublevalue()) 19. max = added; 20. } 21. } Which two, inserted at line 11, will allow the code to compile? (Choose two.) A. public class MinMax<?> { B. public class MinMax<N extends Object> { C. public class MinMax<N extends Integer> { D. public class MinMax<? extends Object> { E. public class MinMax<N extends Number> { F. public class MinMax<? extends Number> { Answer: C,E 13.A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named mylib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class? (Choose three.) A. The JAR file is located at $JAVA_HOME/jre/classes/myLib.jar. B. The JAR file is located at /foo/mylib.jar and the Book class is compiled using javac -d /foo/mylib.jar Book.java C. The JAR file is located at /foo/mylib.jar and a classpath environment variable is set that includes /foo/mylib.jar/paper.class. 8 / 12

D. The JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar.. E. The JAR file is located at /foo/mylib.jar and the Book class is compiled using javac -classpath /foo/mylib.jar Book.java F. The JAR file is located at /foo/mylib.jar and the Book class is compiled using javac -cp /foo/mylib.jar/paper Book.java. G. The JAR file is located at /foo/mylib.jar and a classpath environment variable is set that includes /foo/mylib.jar. Answer: D,E,G 14.Given: 10. public class SuperCalc { 11. protected static int multiply(int a, int b) { return a * b;} 12. } and: 20. public class SubCalc extends SuperCalc{ 21. public static int multiply(int a, int b) { 22. int c = super.multiply(a, b); 23. return c; 24. } 25. } and: 30. SubCalc sc = new SubCalc (); 31. System.out.println(sc.multiply(3,4)); 32. System.out.println(SubCalc.multiply(2,2)); What is the result? A. Compilation fails because of an error in line 31. B. The code runs with no output. C. 12 D. Compilation fails because of an error in line 22. E. An exception is thrown at runtime. F. Compilation fails because of an error in line 21. Answer: D 15.Given: 12. NumberFormat nf = NumberFormat.getInstance(); 13. nf.setmaximumfractiondigits(4); 14. nf.setminimumfractiondigits(2); 15. String a = nf.format(3.1415926); 16. String b = nf.format(2); Which two statements are true about the result if the default locale is Locale.US? (Choose two.) A. The value of a is 3.1415. B. The value of a is 3.14. C. The value of a is 3.141. D. The value of b is 2. 9 / 12

E. The value of b is 2.0000. F. The value of a is 3.1416. G. The value of b is 2.00. Answer: F,G 16.Click the Exhibit button. Which statement is true about the two classes? A. Compilation of class B will fail. Compilation of class A will succeed. B. Compilation of class A will fail. Compilation of class B will succeed. C. Compilation of both classes will fail. D. Compilation of both classes will succeed. Answer: A 17.Given: 11. class ClassA {} 12. class ClassB extends ClassA {} 13. class ClassC extends ClassA {} and: 21. ClassA p0 = new ClassA(); 22. ClassB p1 = new ClassB(); 23. ClassC p2 = new ClassC(); 24. ClassA p3 = new ClassB(); 25. ClassA p4 = new ClassC(); Which three are valid? (Choose three.) A. p2 = p4; B. p2 = (ClassC)p1; C. p0 = p1; D. p2 = (ClassC)p4; E. p1 = p2; F. p1 = (ClassB)p3; Answer: C,D,F 18.Given this method in a class: 10 / 12

21. public String tostring() { 22. StringBuffer buffer = new StringBuffer(); 23. buffer.append('<'); 24. buffer.append(this.name); 25. buffer.append('>'); 26. return buffer.tostring(); 27. } Which statement is true? A. This code will perform well and converting the code to use StringBuilder will not enhance the performance. B. This code will perform poorly. For better performance, the code should be rewritten: return "<" + this.name + ">"; C. This code is NOT thread-safe. D. The programmer can replace StringBuffer with StringBuilder with no other changes. Answer: D 19.DRAG DROP Click the Task button. Answer: 11 / 12

20.Click the Exhibit button. What two must the programmer do to correct the compilation errors? (Choose two.) A. change the wheelcount variable in Car to protected B. insert a call to this() in the MeGo constructor C. insert a call to this() in the Car constructor D. insert a call to super(vin) in the MeGo constructor E. insert a call to super() in the MeGo constructor F. change line 3 in the MeGo class to super.wheelcount = 3; Answer: A,D 12 / 12