




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、SSD3 选择题题库method must exist in every Java application(a) begin(b) paint(c) init(d) mainCorrect answer is (d)2 Which of the following is a valid character.literal in Java(a) ;(b) =(c) (d) aCorrect answer :AJava identifier may begin with all but which of the following(a) $(b) if(c) _ (the underscore)(
2、d) 0Correct answer is (d)the context of Java programming, garbage collection refers to(a) automatic balancing of parenthesis performed by some editors(b) removal of Java programs that could cause damage to a system(c) conversion of comments into Javadoc comments(d) automatic return of memory to the
3、heap for objects no longer required by the programCorrect answer is (d)will be output when the following Java program segment is executedint x = 5;int y = 2;5+2(b) 5 2(c) 7(d) 52Correct answer is (c)5. Which of the following parts of an if-else-statement is optional(a) the if part(b) the else part(c
4、) the parenthesis around the condition(d) the conditionCorrect answer is (b)of the following is the Java loop construct typically used when the range is clear(a) while-loop(b) for-loop(c) switch-loop(d) do-while-loopCorrect answer is (b)the following Java program segment.import .*;public class Test
5、public Test( ) default);public Test( int i ) non-default);public static void main(String args) Test t = new Test(2);Which of the following will be output during execution of the program segment(a) The line of text non-default followed by the line of text default(b) The line of text default followed
6、by the line of text non-default(c) The line of text default(d) The line of text non-defaultCorrect answer is (d)is the name of the JDK program that processes Javadoc comments(a) java(b) javac(c) javacom(d) javadocCorrect answer is (d)to the Java code conventions, files longer than lines should be (a
7、) 100, encouraged(b) 100, avoided(c) 2000, avoided(d) 2000, encouragedCorrect answer is (c)primitive floating-point types available in Java are and .(a) real, double(b) float , double(c) real , float(d) single , realCorrect answer is (b)many bytes are required to represent a Unicode character(a) Fou
8、r(b) One(c) Three(d) TwoCorrect answer is (d)many lines of output will be produced by the following code fragment for (int i = 0; i 4; +i) for (int j = 1; j 3 ; +j) (i + j);(a) 12(b) 6(c) 10(d) 8Correct answer is (d)many lines of output will be produced by the following code fragmentfor (int i = 0;
9、i 3; +i) for (int j = 0; j i; +j) (i + j); (a) 6(b) 4(c) 3(d) 5Correct answer is (c)of the following statements about class variables in Java is not true(a) Class variables require the modifier static in the declarations.instantiatedin the same(b) All objects have their own copy of the class variabl
10、e defined in the class.(c) Non-static methods in a class can access the class variable defined class.(d) Class variables do not need the reference to the object of the instantiated class to access them.Correct answer is (b)term class variable is a synonym for(a) an instance variable(b) a read-only v
11、ariable(c) a private data field(d) a static data fieldCorrect answer is (d)of the following patterns of characters opens a Javadoc comment block(a) /*(b)int x = 5;int y = 2;+ 1 + y);Which of the following statements is true about the program segment(a) The output caused by the code will be 512.(b) T
12、he output caused by the code will be 8.(c) The code will cause a compilation error.(d) The output caused by the code will be 5 1 2.Correct answer is (a)the following Java program segment.import .*;public class SomeClasspublic void x() throw new RuntimeException(Exception from x);public void y()throw
13、 new IOException(Exception from y);Which of the following is true concerning the definitions for the methods x and y(a) Neither x nor y has a legal definition.(b) Both x and y have legal definitions.(c) x has a legal definition, but y has an illegal definition.(d) x has an illegal definition, but y
14、has a legal definition.Correct answer is (c)Java, exceptions that are not handled are passed up the(a) exception ladder(b) call stack(c) catch blocks(d) block hierarchyCorrect answer is (b)a typical debugger encounters a breakpoint, the programmer using the debugger may perform which of the followin
15、g actions1. Examine the values of variables in the halted program2. Execute the current line3. Resume execution of the halted program(a) III only(b) I, II, and III(c) I only(d) I and II onlyCorrect answer is (b)name of a Java source file(a) must use the extension .class(b) must be the same as the cl
16、ass it defines, respecting case(c) must be the same as the class it defines, ignoring case(d) has no restrictionsCorrect answer is (b)difference between the methods print and println of the class is that(a) println appends a new line to the end of its output, but print does not(b) print appends a ne
17、w line to the end of its output, but println does not(c) println inserts a new line at the beginning of its output, but print does not(d) print inserts a new line at the beginning of its output, but println does not Correct answer is (a)is the right way to handle abnormalities in input on Java(a) By
18、 handling these problems by providing exception handlers(b) By always specifying the throws clause in every method header where file I/Ois performed(c) By using the class FileFilter which gracefully filters out bad input data(d) By writing while loops to guard against bad inputCorrect answer is (a)J
19、ava exception classes are derived from the class(a) answer is (b)of the following statements is true of the conventions outlined by Sun Microsystems in the document entitled Code Conventions for the Java Programming Language1. They define a standard interface definition language that must be used fo
20、r allJava classes.2. They provide recommendations intended to make source code easier to read and understand.3. They describe one mechanism for network communication between Java and C+ programs.(a) III only(b) I, II, and III(c) II only(d) I and III onlyCorrect answer is (c)tool that allows programm
21、ers to execute lines of a program one line at a time inorder to help locate the source of a programs errors is known as a(n)(a) debugger(b) stack trace(c) exception handler(d) scopeCorrect answer is (a)of the following is not true concerning objects and their representation(a) objects are represente
22、d by their addresses(b) objects are represented by value(c) objects are represented by reference(d) objects are represented indirectlyCorrect answer is (b)programming, a loop is generally used to achieve(a) branching(b) succession(c) repetition(d) selectionCorrect answer is (c)a class contains a con
23、structor, that constructor will be invoked(a) each time an object of that class goes out of scope(b) once at the beginning of any program that uses that class(c) once the first time an object of that class is instantiated(d) each time an object of that class is instantiatedCorrect answer is (d) of t
24、he following categorizations can be applied to both the data fields and the methods in a Java class(a) native and non-native(b) static and non-static(c) default and non-default(d) abstract and non-abstractCorrect answer is (b)10. According to the Java code conventions, files that contain Java source
25、 code havethe suffix , and compiled bytecode files have the suffix .(a) .javac, .class(b) .java, .class(c) .class, .javac(d) .class, .javaCorrect answer is (b)of primitive types are also referred to as(a) references(b) classes(c) objects(d) scalarsCorrect answer is (d)on the following declaration, w
26、hat does b1 represent just after the declarationis executedButton b1;(a) a default Button object(b) a Button object with no label(c) a blank Button object(d) nothingCorrect answer is (d)8. The return type for a method that returns nothing to its caller is(a) not specified in the method definition(b)
27、 false(c) null(d) voidCorrect answer is (d)is the name of the wrapper class for the type int(a) Integer(b) INT(c) integer(d) IntCorrect answer is (a)(*)3. Which of the following statements is (are) true about the use of an asterisk in a Java import statementIt does not incur run-time overhead.It can
28、 be used to import multiple packages with a single statement.It can be used to import multiple classes with a single statement.(a) III only(b) I and III only(c) I only(d) I, II, and IIICorrect answer is (b)4. What will be output caused by the execution of the following Java program segmentString name = Elvis;+ was here);(a) Elviswas here(b) name was here(c) Elvis was here(d) name + was hereCorrect a
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 天津育才中学三年级下册科学期末试卷真题汇编解析版
- 【化学】九年级化学图像题-pH的变化图像题20套(带答案)
- 【语文】延安市小学五年级下册期末试题(含答案)
- 2025年地质工程考试题及答案
- 2025年注册会计师全国统一考试CPA税法机考系统模拟卷含答案
- 2025年水运工程试验检测师资格考试水运材料经典试题及答案
- 2025国际汉语教师证书考试教学研究方法试卷及答案
- 2025年二级建造师之二建建筑工程实务题库及答案
- 2025年全国会计专业技术资格考试习题集及答案
- 2025年检验类之临床医学检验技术(士)高分通关题型题库附解析答案
- 新疆维吾尔自治区成立70周年心得体会二
- 2025年部编版新教材道德与法治二年级上册教学计划(含进度表)
- 基于杜邦分析法的公司盈利能力研究-以宁德时代新能源科技股份有限公司为例
- GB/T 45932-2025高压直流开关设备和控制设备标准的共用技术要求
- 系统运营管理办法
- 清华大学(夏建军):2025年供热碳排放核算和碳责任分摊报告
- 传染病专科重点建设计划
- 文明守纪教育主题班会
- 原发性血管炎肾损害护理
- 2025年教师资格证面试结构化面试真题卷:小学信息技术教学案例分析
- 药品进货查验管理制度
评论
0/150
提交评论