【计算机类职业资格】计算机Java认证-分包、编译和解释Java代码、Java语句编程及答案解析.doc
《【计算机类职业资格】计算机Java认证-分包、编译和解释Java代码、Java语句编程及答案解析.doc》由会员分享,可在线阅读,更多相关《【计算机类职业资格】计算机Java认证-分包、编译和解释Java代码、Java语句编程及答案解析.doc(16页珍藏版)》请在麦多课文档分享上搜索。
1、计算机 Java认证-分包、编译和解释 Java代码、Java 语句编程及答案解析(总分:96.00,做题时间:90 分钟)一、B不定项选择题/B(总题数:26,分数:96.00)1.Which two import statements will allow for the import of the HashMap class? A. import java.util.HashMap; B. import java.util.*; C. import java.util.HashMap.*; D. import java.util.hashMap;(分数:4.00)A.B.C.D.2.Wh
2、ich statement would designate that your file belongs in the package com. ocajexam.utilities? A. pack com.ocajexam.utilities; B. Package com.ocajexam.utilities.* C. package com.ocajexam.utilities.*; D. package com.ocajexam.utilities;(分数:4.00)A.B.C.D.3.Which of the following is the only Java package t
3、hat is imported by default? A. java.awt B. java.lang C. java.util D. java.io(分数:4.00)A.B.C.D.4.What Java-related features are new to J2SE 5.0? A. Static imports B. package and import statements C. Autoboxing and unboxing D. The enhanced for loop(分数:4.00)A.B.C.D.5.The JCheckBox and JComboBox classes
4、belong to which package? A. java.awt B. javax.awt C. java.swing D. javax.swing(分数:4.00)A.B.C.D.6.Which package contains the Java Collections Framework? A. java.io B. C. java.util D. java.utils(分数:4.00)A.B.C.D.7.The Java Basic I/O API contains what types of classes and interfaces? A. Internationaliz
5、ation B. RMI, JDBC, and JNDI C. Data streams, serialization, and file system D. Collection API and data streams(分数:4.00)A.B.C.D.8.Which API provides a lightweight solution for GUI components? A. AWT B. Abstract Window Toolkit C. Swing D. AWT and Swing(分数:4.00)A.B.C.D.9.Consider the following illustr
6、ation. What problem exists with the packaging? You may wish to reference Appendix G on the Unified Modeling Language (UML) for assistance.(分数:4.00)A.B.C.D.10.When apply naming conventions, which Java elements should start with a capital letter and continue on using the camel case convention? A. Clas
7、s names B. Interface names C. Constant names D. Package names E. All of the above(分数:4.00)A.B.C.D.E.11.When instantiating an object with generics, should angle brackets, box brackets, parentheses, or double-quotes be used to enclose the generic type? Select the appropriate answer. A. List Integer a
8、= new ArrayList Integer (); B. List Integer a = new ArrayList Integer (); C. List Integer a = new ArrayList Integer (); D. List “Integer“ a = new ArrayList “Integer“ ();(分数:4.00)A.B.C.D.12.When organizing the elements in a class, which order is preferred? A. Data members, methods, constructors B. Da
9、ta members, constructors, methods C. Constructors, methods, data members D. Constructors, data members, methods E. Methods, constructors, data members(分数:4.00)A.B.C.D.E.13.Which usage represents a valid way of compiling a Java class? A. java MainClass.class B. javac MainClass C. javac MainClass.sour
10、ce D. javac MainClass.java(分数:4.00)A.B.C.D.14.Which two command-line invocations of the Java interpreter return the version of the interpreter? A. java -version B. java -version C. java -version ProgramName D. java ProgramName -version(分数:4.00)A.B.C.D.15.Which two command-line usages appropriately i
11、dentify the classpath? A. javac -cp/project/classes/MainClass.java B. javac -sp/project/classes/MainClass.java C. javac -classpath/project/classes/MainClass.java D. javac -classpaths/project/classes/MainClass.java(分数:4.00)A.B.C.D.16.Which command-line usages appropriately set a system property value
12、? A. java -Dcom.ocajexam.propertyValue=003 MainClass B. java -d com.ocajexam.propertyValue=003 MainClass C. java -prop com.ocajexam.propertyValue=003 MainClass D. java -D:com.ocajexam.propertyValue=003 MainClass(分数:4.00)A.B.C.D.17.Which is not a type of statement? A. Conditional statement B. Assignm
13、ent statement C. Iteration statement D. Propagation statement(分数:4.00)A.B.C.D.18.What type of statement is the following equation: y = (m*x)+b? A. Conditional statement B. Assignment statement C. Assertion statement D. Transfer of control statement(分数:4.00)A.B.C.D.19.Which statements correctly decla
14、re boolean variables? A. Boolean isValid = true; B. boolean isValid = TRUE; C. boolean isValid = new Boolean(true); D. boolean isValid = 1;(分数:4.00)A.B.C.D.20.Given x is declared with a valid integer, which conditional statement will not compile? A. if(x = 0) System.out.println(“True Statement“); B.
15、 if(x = 0) System.out.println(“False Statement“); C. if(x = 0) ; elseif(x = 1)System.out.println(“Valid Statement“); D. if(x = 0); else if(x = 1) else ;(分数:4.00)A.B.C.D.21.A switch statement works with which wrapper class/reference type(s)? A. Character B. Byte C. Short D. Int(分数:4.00)A.B.C.D.22.Whi
16、ch of the following statements will not compile? A. if(true); B. if(true) C. if(true) ; D. if(true) ; E. if(true); ; F. All statements will compile.(分数:4.00)A.B.C.D.E.F.23.Given:public class Dinner public static void main (String args)boolean isKeeperFish = false;if (isKeeperFish = true) System.out.
17、println(“Fish for dinner“); else System.out.println(“Take out for dinner“);What will be the result of the applications execution? A. Fish for dinner will be printed. B. Take out for dinner will be printed. C. A compilation error will occur.(分数:2.00)A.B.C.24.You need to update a value of a hash table
18、 (that is, HashMap) where the primary key must equal a specified string. Which statements would you need to use in the implementation of this algorithm? A. Iteration statement B. Expression statement C. Conditional statement D. Transfer of control statement(分数:2.00)A.B.C.D.25.The for loop has been e
19、nhanced in Java 5.0. Which is not a common term for the improved for loop? A. The for in loop B. The specialized for loop C. The for each loop D. The enhanced for loop(分数:2.00)A.B.C.D.26.Which keyword is part of a transfer of control statement? A. if B. return C. do D. assert(分数:2.00)A.B.C.D.计算机 Jav
20、a认证-分包、编译和解释 Java代码、Java 语句编程答案解析(总分:96.00,做题时间:90 分钟)一、B不定项选择题/B(总题数:26,分数:96.00)1.Which two import statements will allow for the import of the HashMap class? A. import java.util.HashMap; B. import java.util.*; C. import java.util.HashMap.*; D. import java.util.hashMap;(分数:4.00)A. B. C.D.解析:HashMap
21、 类可以直接通过 import java.util.HashMap或者使用通配符通过 import java.util.*;而导入。C 和 D不正确。C 不正确,因为这个答案是一条静态的 import语句,它导入 HashMap类的静态成员,而不是类本身。D 不正确,因为类名是大小写敏感的,所以类名 hashMap不等于 HashMap。2.Which statement would designate that your file belongs in the package com. ocajexam.utilities? A. pack com.ocajexam.utilities; B
22、. Package com.ocajexam.utilities.* C. package com.ocajexam.utilities.*; D. package com.ocajexam.utilities;(分数:4.00)A.B.C.D. 解析:使用关键字 package是正确的,紧跟着是以点分隔的包名,后紧跟一个分号。A、B 和 C不正确。A不正确,因为单词 pack不是有效的关键字。B 不正确,因为 package语句必须以分号结尾,并且在package语句中不能使用星号。C 不正确,因为不能在 package语句中使用星号。3.Which of the following is
23、the only Java package that is imported by default? A. java.awt B. java.lang C. java.util D. java.io(分数:4.00)A.B. C.D.解析:java.lang 包是所有类都默认导入的唯一包。A、C 和 D不正确。java.awt、java.util 和 java.io包中的类都不是默认导入的。4.What Java-related features are new to J2SE 5.0? A. Static imports B. package and import statements C.
24、 Autoboxing and unboxing D. The enhanced for loop(分数:4.00)A. B.C. D. 解析:静态导入、自动装箱/拆箱和增强的 for循环都是 J2SE 5.0的新功能。B 不正确,因为基本的package和 import语句对于 J2SE 5.0不是新的。5.The JCheckBox and JComboBox classes belong to which package? A. java.awt B. javax.awt C. java.swing D. javax.swing(分数:4.00)A.B.C.D. 解析:属于 Swing
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
5000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机 职业资格 JAVA 认证 分包 编译 解释 代码 语句 编程 答案 解析 DOC

链接地址:http://www.mydoc123.com/p-1336859.html