- 1、本文档共5页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
ocjp题笔记
* B1. class Batman{2. int squares = 81;3. public static void main(String[ ] args){4. new Batman().go();5. }6. void go(){7. incr(++squares);8. System.out.println(squares);9. }10. void incr(int squares){squares += 10;}[微软用户1]?11. }What is the result??[微软用户1]Squares只是一个形参,可以换成x,那就是x+=10;与类变量squares无关 81 82 91 92 Compilation fails. An exception is thrown at runtime. AD A team of programmers is reviewing a proposed API for a new utility class. After some discussion, they realize that they can reduce the number of methods in the API without losing any functionality. If they implement the new design, which two OO principles will they be promoting? A. Looser coupling //低耦合 B. Tighter coupling //紧耦合(实际上一般都是) C. Lower cohesion //低内聚(实际上一般都是) D. Higher cohesion //高内聚 E. Weaker encapsulation F. Stronger encapsulation BCF 10. interface Jumper{public void jump();} ... 20. class Animal{} ... 30. class Dog extends Animal{ 31. Tail tail; 32. } ... 40. class Beagle extends Dog implements Jumper{ 41. public void jump(){} 42. } ... 50. class Cat implements Jumper{ 51. public void jump(){} 52. } Which three are true? (Choose three.) A. Cat is-a Animal B. Cat is-a Jumper C. Dog is-a Animal D. Dog is-a Jumper E. Cat has-a Animal F. Beagle has-a Tail G. Beagle has-a Jumper BCE 10. class One{ 11. void foo(){ } //默认的修饰符 default 12. } 13. class Two extends One{ 14. //insert method here 15. } Which three methods, inserted individually at line 14, will correctly complete class Two? (Choose three.) A. int foo(){/* more code here */} //重载,参数列表必须不一样 B. void foo(){/* more code here */} //重写父类的方法, C. public void foo(){/* more code here */} //同上 D. private void foo(){/* more code here */} //肯定不行,不能有更高的权限 E. protected void foo(){/* more code here */} //重写 Public protected default private *
您可能关注的文档
- IOport中的GPFCON和GPFDAT寄存器(裸奔LED驱动实例).docx
- ios7美化教程.doc
- 河南农业大学本科生毕业论文(设计).doc
- iothreads代码阅读笔记.doc
- IOS61修改运营商图标教程.doc
- 泵站施工技术交底720.doc
- 注册土木工程师(港口与航道工程)专业考试所使用的规范标准.doc
- 洪翔中学2015监理规划.doc
- iptable使用实例.doc
- Indiancamp原文及赏析.doc
- springbooot+vue基于java的房屋维修系统毕业论文.doc
- 中国消防救援学院《单片机系统实验》2023-2024学年第一学期期末试卷.doc
- 2025年溧阳纺织化学品项目申请.pptx
- 景区门票包销合同模板(3篇).docx
- 【股票技术指标学习指南】第七章第三节货币需要量的测算.doc
- 2025春 _ 人教版七年级英语下册【unit4】看音标写单词.doc
- 2025春 _ 人教版七年级英语下册【unit5】看音标写单词.doc
- 2025春 _ 人教版七年级英语下册【unit6】看音标写单词.doc
- 2025春 _ 人教版七年级英语下册【unit7】看音标写单词.doc
- 2025春 _ 人教版七年级英语下册【unit8】看音标写单词.doc
文档评论(0)