- 1、本文档共16页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Module 0 3- 面向对象编程
Copyright Tarena Corporation,2008.All rights reservedModule 0 3- 面向对象编程一、选择题 :Question 1Given:20. public class CreditCard {21.22. private String cardlD;23. private Integer limit;24. public String ownerName;25.26. public void setCardlnformation(String cardlD,27. String ownerName,28. Integer limit) {29. this.cardlD = cardlD;30. this.ownerName = ownerName;31. this.limit = limit;32. }33. }Which is true?A. The class is fully encapsulated.B. The code demonstrates polymorphism.C. The ownerName variable breaks encapsulation.D. The cardlD and limit variables break polymorphism.E. The setCardlnformation method breaks encapsulation.Answer: CQuestion 2Which two are true? (Choose two.)A. An encapsulated, public class promotes re-use.B. Classes that share the same interface are always tightlyencapsulated.C. An encapsulated class allows subclasses to overload methods, butdoes NOT allow overriding methods.D. An encapsulated class allows a programmer to change animplementation without affecting outside code.Answer: ADQuestion 3Assume that country is set for each class.Given:10. public class Money {11. private String country, name;12. public getCountry() { return country; }Copyright Tarena Corporation,2008.All rights reserved13.}and:24. class Yen extends Money {25. public String getCountry() { return super.country; }26. }27.28. class Euro extends Money {29. public String getCountry(String timeZone) {30. return super.getCountry();31. }32. }Which two are correct? (Choose two.)A. Yen returns correct values.B. Euro returns correct values.C. An exception is thrown at runtime.D. Yen and Euro both return correct values.E. Compilation fails because of an error at line 25.F. Compilation fails because of an error at line 30.Answer: BEQuestion 4Given:10. interface A { void x(); }11. class B implements A { public void x() { } public void y() { } }12. class C extends B { public void x() {} }And:20. java.util.ListA list = new java.util.ArrayListA();21. list.add(new B());22. list.add(new C());23. f
您可能关注的文档
- 05-民营润滑油企业如何在竞争中打造自身品牌-陈晓星.pdf
- 03_j2me详述.ppt
- 浅析学校教育与家庭教育相结合.doc
- 10年中考数学必威体育精装版综合练习试卷4(pdf版).pdf
- 10年中考数学必威体育精装版综合练习试卷5(pdf版).pdf
- 09案例习题集.doc
- 06射频器件与天馈介绍.ppt
- 18步磨皮.doc
- 17.香港中药材标准附录VI.pdf
- 11第四章 顶驱钻井系统.doc
- 2024安徽省工业高级技工学校工作人员招聘考试真题及答案汇总.docx
- 传感器原理与应用(第4版) 教案 孟立凡 -第一节:传感器概述---第七节:电容式传感器(二).doc
- 2024安徽省马鞍山工业学校工作人员招聘考试真题及答案汇总.docx
- 2025年中国套装旋具数据监测研究报告.docx
- 2024安徽省公路工程技工学校工作人员招聘考试真题及答案汇总.docx
- 2024安徽省宿州逸夫师范学校工作人员招聘考试真题及答案汇总.docx
- 2024安徽淮北煤电技师学院工作人员招聘考试真题及答案汇总.docx
- 2025年中国黄木纹板岩数据监测报告.docx
- 2025年中国涡轮对夹式蝶阀数据监测研究报告.docx
- 古建筑湖南现存的40课件.pptx
文档评论(0)