没有合适的资源?快使用搜索试试~ 我知道了~
首页SSD3 Multiple-Choice 整理
SSD3 Multiple-Choice 整理
需积分: 9 17 下载量 146 浏览量
更新于2023-03-03
评论
收藏 148KB DOC 举报
SSD3所有Multiple-Choice 的整合带答案 对Java部分的学习有帮助
资源详情
资源评论
资源推荐
Multiple-Choice Quiz 1
1. Which method must exist in every Java application?
(a) begin
(b) main
(c) paint
(d) init
Correct answer is (b)
Your score on this question is: 10.00
Feedback:
See section 1.1.1 of the course notes.
(b)
--------------------------------------------------------------------------------
2. Based on the following declaration, what does b1 represent just after the declaration is
executed?
Button b1;
(a) a blank Button object
(b) a "default" Button object
(c) a Button object with no label
(d) nothing
Correct answer is (d)
Your score on this question is: 0.00
Feedback:
See section 1.1.2 Data: Primitives and Objects of the course notes.
(c)
--------------------------------------------------------------------------------
3. Which of the following is not true concerning objects and their representation?
(a) objects are represented by their addresses
(b) objects are represented by value
(c) objects are represented by reference
(d) objects are represented indirectly
Correct answer is (b)
Your score on this question is: 0.00
Feedback:
See section 1.1.2 of the course notes.
(a)
--------------------------------------------------------------------------------
4. Which expression below evaluates to true if and only if x is in the range [0, 9] (inclusive)?
(a) !(x < 0 || x > 9)
(b) 0 <= x >= 9
(c) 0 < x < 9
(d) x > 0 && x < 9
Correct answer is (a)
Your score on this question is: 10.00
Feedback:
See section 1.1.3 of the course notes.
(a)
--------------------------------------------------------------------------------
5. Which of the following statements is used to exit from a switch statement?
(a) end;
(b) default;
(c) break;
(d) exit;
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See section 1.1.4 Control Statements of the course notes.
(c)
--------------------------------------------------------------------------------
6. How many lines of output will be produced by the following code fragment?
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < i; ++j) {
stdOut.println(i + j);
} }
(a) 3
(b) 4
(c) 6
(d) 5
Correct answer is (a)
Your score on this question is: 0.00
Feedback:
See section 1.1.4 Control Statements of the course notes.
(c)
--------------------------------------------------------------------------------
7. Which of the following statements about constructors in Java is true?
(a) A class must define at least one constructor.
(b) A class can define more than one constructor.
(c) A constructor must be defined as static.
(d) A constructor must be defined as public.
Correct answer is (b)
Your score on this question is: 0.00
Feedback:
See section 1.1.5 Classes of the course notes.
(a)
--------------------------------------------------------------------------------
8. The return type for a method that returns nothing to its caller is
(a) not specified in the method definition
(b) false
(c) null
(d) void
Correct answer is (d)
Your score on this question is: 10.00
Feedback:
See section 1.1.5 Classes of the course notes.
(d)
--------------------------------------------------------------------------------
9. Which of the following patterns of characters opens a Javadoc comment block?
(a) /*
(b) //
(c) /**
(d) **/
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See section 1.1.7 of the course notes.
(c)
--------------------------------------------------------------------------------
10. 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) I and II only
(c) II and III only
(d) II only
Correct answer is (d)
Your score on this question is: 10.00
Feedback:
See section 1.1.6, subsection "CodeConvTOC" and section 2.1, subsection "File Suffixes," in the
course notes.
(d)
--------------------------------------------------------------------------------
3. In Java, which of the following is a legal declaration of an integer constant SCALE?
(a) int final SCALE = 10;
(b) final int SCALE = 10;
(c) int constant SCALE = 10;
(d) constant int SCALE = 10;
Correct answer is (b)
Your score on this question is: 10.00
Feedback:
See section 1.1.2 Data: Primitives and Objects of the course notes.
(b)
--------------------------------------------------------------------------------
4. What will be output when the following Java program segment is executed?
int x = 5;
int y = 2;
System.out.println(x+y);
(a) 5 2
(b) 52
(c) 5+2
(d) 7
Correct answer is (d)
Your score on this question is: 10.00
Feedback:
See section 1.1.3 in the course notes.
(d)
--------------------------------------------------------------------------------
5. In programming, a loop is generally used to achieve
(a) selection
(b) repetition
(c) branching
(d) succession
Correct answer is (b)
Your score on this question is: 10.00
Feedback:
See section 1.1.4 Control Statements of the course notes.
(b)
--------------------------------------------------------------------------------
7. The term class variable is a synonym for
(a) a read-only variable
(b) a private data field
(c) a static data field
(d) an instance variable
Correct answer is (c)
Your score on this question is: 0.00
Feedback:
See section 1.1.5 Classes of the course notes.
(a)
--------------------------------------------------------------------------------
10. According to the Java code conventions, files that contain Java source code have the suffix
_____, and compiled bytecode files have the suffix _____.
(a) .class, .java
(b) .javac, .class
(c) .class, .javac
(d) .java, .class
Correct answer is (d)
Your score on this question is: 10.00
Feedback:
See section 1.1.6, subsection "CodeConvTOC" and section 2.1, subsection "File Suffixes," in the
course notes.
(d)
Multiple-Choice Quiz 2
1. Which of the following is the string concatenation operator in Java?
(a) ^
(b) +
(c) &
(d) ++
Correct answer is (b)
Your score on this question is: 10.00
Feedback:
See section 1.1.3 of the course notes.
(b)
--------------------------------------------------------------------------------
2. What will be output caused by the execution of the following Java program segment?
String name = "Elvis";
System.out.print(name + "was here");
(a) name + was here
(b) Elviswas here
(c) Elvis was here
(d) name was here
Correct answer is (b)
Your score on this question is: 0.00
Feedback:
See section 1.1.3 of the course notes.
(c)
--------------------------------------------------------------------------------
3. Given the following code, how many tokens will be output?
StringTokenizer st = new StringTokenizer("this is a test");
while (st.hasMoreTokens()) {
stdOut.println(st.nextToken() );
}
剩余26页未读,继续阅读
IS1234
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 27页智慧街道信息化建设综合解决方案.pptx
- 计算机二级Ms-Office选择题汇总.doc
- 单链表的插入和删除实验报告 (2).docx
- 单链表的插入和删除实验报告.pdf
- 物联网智能终端项目设备管理方案.pdf
- 如何打造品牌的模式.doc
- 样式控制与页面布局.pdf
- 武汉理工Java实验报告(二).docx
- 2021线上新品消费趋势报告.pdf
- 第3章 Matlab中的矩阵及其运算.docx
- 基于Web的人力资源管理系统的必要性和可行性.doc
- 基于一阶倒立摆的matlab仿真实验.doc
- 速运公司物流管理模式研究教材
- 大数据与管理.pptx
- 单片机课程设计之步进电机.doc
- 大数据与数据挖掘.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0