ssd3 Multiple-Choice Quiz 1
来源:互联网 发布:淘宝 手机店 推荐 编辑:程序博客网 时间:2024/06/06 10:43
Which method must exist in every Java application?
(a)
main
(b)
paint
(c)
begin
(d)
init
Answer:a
每个Java application 里面都必定含有main函数,否则程序无法运行。
2.
Which of the following is the string concatenation operator in Java?
(a)
+
(b)
^
(c)
&
(d)
++
Answer:a
连接两个string的操作符自然是“+”。
3.
Which of the following statements is (are) true about the use of an asterisk (*) in a Java import
statement?
- It does not incur run-time overhead.
- It can be used to import multiple packages with a single statement.
- It can be used to import multiple classes with a single statement.
(a) I and III only
(b) III only
(c) I only
(d) I, II, and III
Answer:a
I. import的包在编译时就被导入参与编译并参与运行,而不会跳过编译直接在运行时空降。
III. “*”替代了某包某父类的所有子类,如:import java.io.*; 。
4.
A difference between the methods print
and println
of the class java.io.PrintWriter
is that
(a)
print
inserts a new line at the beginning of its output, but println
does not(b)
println
appends a new line to the end of its output, but print
does not(c)
println
inserts a new line at the beginning of its output, but print
does not(d)
print
appends a new line to the end of its output, but println
does not
Answer:b
println相当于在print输出的语句后加一个换行(/n)。
5.
What will be output when the following Java program segment is executed?
int x = 5; int y = 2; System.out.println(x + y);
(a) 7
(b) 5 2
(c) 5+2
(d) 52
Answer:a
“+”连接两个数字则直接输出运算结果。
6.
What is the right way to handle abnormalities in input on Java?
(a) By handling these problems by providing exception handlers
(b) By writing
while
loops to guard against bad input(c) By using the class
FileFilter
which gracefully filters out bad input data(d) By always specifying the
throws
clause in every method header where file I/O is performed
Answer:a
通过提供异常处理来解决问题。
7.
All Java exception classes are derived from the class
(a)
java.lang.Throwable
(b)
java.lang.Error
(c)
java.io.IOException
(d)
java.lang.RuntimeException
Answer:a
java.lang.Throwable是所有异常的父类;而java.io.IOException只是输入输出异常的父类。
8.
According to Javadoc convention, the first sentence of each Javadoc comment should be
(a) an
@version
tag(b) the order of lines is not important
(c) an
@author
tag(d) a summary sentence of the declared entry
Answer:d
Javadoc注释开头是概述部分。
9.
According to the document entitled Code Conventions for the Java Programming Language, file suffixes used by Java software include which of the following?
.obj
.class
.h
(a) I and III only
(b) II and III only
(c) I and II only
(d) II only
Answer:d
.obj 目标文件 .h 头文件(java中没有头文件一说)
所有以文本方式存在的.java文件在编译时自动生成.class文件参与运行。
10.
A stack trace is
(a) a sequence of method calls
(b) only available through a typical debugger's step into feature
(c) a fatal error that causes a typical debugger to terminate
(d) a list of variables allocated on a program's stack
Answer:a
堆栈跟踪是指函数调用的顺序。
- SSD3 Multiple-Choice Quiz 1
- ssd3 Multiple-Choice Quiz 1
- SSD3 Multiple-Choice Quiz 3
- SSD3 : Multiple-Choice Quiz 4
- ssd3 Multiple-Choice Quiz 2
- SSD6 Multiple-Choice Quiz 4
- ssd3:Practical Quiz 1 SecondsCalculator
- ssd6选择题——multiple-choice quiz 1
- View Assessment Result: Multiple-Choice Quiz 2
- ssd3:Practical Quiz 1 iCarnegie Information
- ssd3:Practical Quiz 2 Debugging Class DNASequence
- Multiple choice listview in Android
- hdu 1712, multiple-choice knapsack,
- The ThreeWays about Radio , the multiple choice ......
- 2E02-View-Lists-multiple -choice-list
- ssd3: Exercise 1 Shopping Cart Application
- 常用的dialog,包括:single Choice Dialog,Multiple choice Dialog,Input Dialog ,Progress Dialog....
- CHOICE
- rdlc报表纵向单元格无法合并的解决方法
- C#消息机制
- Linux字符设备驱动程序的编写框架
- Hibernate的检索方式详解
- 交互的本质思考
- ssd3 Multiple-Choice Quiz 1
- 超强android粉丝是这样滴
- 看门狗
- QT4.3.0在VC++ 6.0下安装指南
- DOJO基础
- Windows网络编程-(完成端口及网络编程)详细介绍
- Threading in C# ,phase 1
- 创建线程时的几个陷阱
- IEEE1284 USB转并口打印线缆配置