OCJP (1Z0-808) 个人笔记(5)

121.略

122.private无法被本类外元素看到并调用。

123.没有正确答案。C中应为==

124.数组中元素非引用。即便是String数组。


输出:

125.略

126.

127.子类重写父类方法时,方法修饰符权限不能低于父类原方法。

128.略

129.Exception e也是被创造出的实例。

130.控制台默认输入类型为String。args[0]只接受第一个输入的数据。

131.略

132.存疑

133.MarkList obj3=null,只是在栈中创建了一个变量,无指向对象,堆中没有分配内存。

        new的时候在栈中创建变量,有指向对象,堆中分配内存。

134.如果 sum是成员变量,JVM会主动赋值。

类里定义的数据成员称为属性,属性可不赋初值,若不赋初值则JAVA会按上表为其添加默认值;方法里定义的数据成员称为变量,变量在参与运算之前必须赋初值。

https://www.cnblogs.com/renyuan/archive/2012/11/07/2758507.html

这样定义的话会print出sum=0而不是报错

135.136.137.略

138.throwable下的error和exception下的runtime exception属于unchecked exception

139.略

140.略

141.DoClass在p3中重新定义了空输入的构造函数,重新定义的类型为default,在其他包中的test看不到这条默认构造。

142.多态的优点。

143.略

144.略

145.抽象类中可以没有抽象方法,但是非抽象方法不能有body。final不能用于抽象类,final所描述的类不能被继承。

146.names.remove去除了第一个Bran,if语句中的值为true。

147.break,continue只跳出一层循环,return结束整个循环。

148.remove用于List和ArrayList,StringBuilder没有size,类似String,只有length。

149.在编译的时候选择了编译Sub,运行的时候运行Sub下的main方法。

150.Java8中新增的default特性,可以在接口中定义拥有函数体的函数。使继承接口不必多次复写同一内容。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Title: OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808 Author: Jeanne Boyarsky, Scott Selikoff Length: 432 pages Edition: 1 Language: English Publisher: Sybex Publication Date: 2014-12-31 ISBN-10: 1118957407 ISBN-13: 9781118957400 Full coverage of functional programming and all OCA Java Programmer exam objectives OCA, Oracle Certified Associate Java SE 8 Programmer I Study Guide, Exam 1Z1-808 is a comprehensive study guide for those taking the Oracle Certified Associate Java SE 8 Programmer I exam (1Z1-808). With complete coverage of 100% of the exam objectives, this book provides everything you need to know to confidently take the exam. The release of Java 8 brought the language's biggest changes to date, and for the first time, candidates are required to learn functional programming to pass the exam. This study guide has you covered, with thorough functional programming explanation and information on all key topic areas Java programmers need to know. You'll cover Java inside and out, and learn how to apply it efficiently and effectively to create solutions applicable to real-world scenarios. * Work confidently with operators, conditionals, and loops * Understand object-oriented design principles and patterns * Master functional programming fundamentals Table of Contents Chapter 1 Java Building Blocks Chapter 2 Operators and Statements Chapter 3 Core Java APIs Chapter 4 Methods and Encapsulation Chapter 5 Class Design Chapter 6 Exceptions Appendix A Answers to Review Questions Appendix B Study Tips
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值