- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
java进阶复习题
Name:_______________________
Covers Chs 29-31 Sample Exam
Multiple Choice Questions Only for This Test
Part I: Questions: (1 pts each)
1 You should always invoke the unlock method in the finally clause.
A. true
B. false
2 Given the following code, which set of code can be used to replace the comment so that the program displays time to the console every second?
import java.applet.*;
import java.util.*;
public class Test extends Applet implements Runnable {
public void init() {
Thread t = new Thread(this);
t.start();
}
public void run() {
for(; ;) {
//display time every second
System.out.println(new Date().toString());
}
}
}
A. try { Thread.sleep(1000); } catch(InterruptedException e) { }
B. try { sleep(1000); } catch(InterruptedException e) { }
C. try { Thread.sleep(1000); } catch(RuntimeException e) { }
D. try { t.sleep(1000); } catch(InterruptedException e) { }
3 Which of the following expressions must be true if you create a thread using Thread = new Thread(object)?
A. object instanceof Applet
B. object instanceof Thread
C. object instanceof Frame
D. object instanceof Runnable
4 How do you create a condition on a lock?
A. Condition condition = Lock.getCondition();
B. Condition condition = Lock.newCondition();
C. Condition condition = lock.getCondition();
D. Condition condition = lock.newCondition();
5 Which method on a condition should you invoke to causes the current thread to wait until the condition is signaled?
A. condition.waited();
B. condition.await();
C. condition.waiting();
D. condition.wait();
6 To run an object on a separate thread, the object must be a subclass of Thread.
A. true
B. false
7 The Runnable interface is more general than the Thread class. You can convert any class that extends Thread to a class that implements Runnable.
A. true
B. false
8 An exception occurs if the resume() method is invoked by a finished thread object.
A. true
B. false
9 You can set a priorit
您可能关注的文档
- Java语言程序设计(一)白皮书题库(一).doc
- 计算器小程序java.doc
- Java开源项目—验证码kaptcha.doc
- 11第十一章 Java的GUI编程初步实验代码.doc
- Java Server Page讲义.docx
- Java实验报告9-CS程序的结构和工作原理.doc
- java读取properties文件总结.doc
- Java笔试试卷和机试题目答案.doc
- java商品管理系统2.doc
- Java第七次实验报告.doc
- 信息技术结业考试试题.docx
- 2025年山东省科创集团有限公司招聘(33人)考前自测高频考点模拟试题及.docx
- 第04讲 微写作(专项训练)(含答案)2026年高考一轮语文复习讲练测(全国通用).docx
- 2026年高考历史总复习必修三(文化史)知识总结.docx
- 专题06 建议信模板 (解析版)-2026年高考英语写作常考题型高分技能全面突破(全国通用).docx
- 2026年高考语文议论文写作指南:从逻辑构建到表达技巧(全国通用).docx
- 2026年高考化学一轮复习讲练测:原子结构与性质(专项训练)含答案.docx
- 第07讲 话题作文(专项训练)(含答案)2026年高考一轮语文复习讲练测(全国通用).docx
- 2026年高考化学一轮复习讲练测:硫及其重要化合物(专项训练)含答案.docx
- 2026年高考语文备考现代文阅读之小说阅读答题模板+反套路新探索.docx
原创力文档


文档评论(0)