Skip to main content

OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808

OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808

Jeanne Boyarsky, Scott Selikoff

ISBN: 978-1-118-95742-4

Dec 2014

432 pages

$38.99

Description

Full coverage of functional programming and all OCA Java Programmer exam objectives

OCA, Oracle Certified Associate Java SE 8 Programmer I Study Guide, Exam 1Z0-808 is a comprehensive study guide for those taking the Oracle Certified Associate Java SE 8 Programmer I exam (1Z0-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

Related Resources

Introduction xxi

Assessment Test xxxi

Chapter 1 Java Building Blocks 1

Understanding the Java Class Structure 2

Fields and Methods 2

Comments 4

Classes vs. Files 5

Writing a main() Method 6

Understanding Package Declarations and Imports 9

Wildcards 10

Redundant Imports 11

Naming Conflicts 12

Creating a New Package 13

Code Formatting on the Exam 16

Creating Objects 16

Constructors 17

Reading and Writing Object Fields 18

Instance Initializer Blocks 18

Order of Initialization 19

Distinguishing Between Object References and Primitives 20

Primitive Types 20

Reference Types 24

Key Differences 25

Declaring and Initializing Variables 25

Declaring Multiple Variables 26

Identifiers 27

Understanding Default Initialization of Variables 29

Local Variables 29

Instance and Class Variables 30

Understanding Variable Scope 31

Ordering Elements in a Class 34

Destroying Objects 36

Garbage Collection 36

finalize() 38

Benefits of Java 39

Summary 40

Exam Essentials 41

Review Questions 42

Chapter 2 Operators and Statements 51

Understanding Java Operators 52

Working with Binary Arithmetic Operators 53

Arithmetic Operators 53

Numeric Promotion 55

Working with Unary Operators 57

Logical Complement and Negation Operators 57

Increment and Decrement Operators 58

Using Additional Binary Operators 60

Assignment Operators 60

Compound Assignment Operators 62

Relational Operators 63

Logical Operators 64

Equality Operators 65

Understanding Java Statements 66

The if-then Statement 67

The if-then-else Statement 68

The switch Statement 72

The while Statement 76

The do-while Statement 78

The for Statement 80

Understanding Advanced Flow Control 86

Nested Loops 87

Adding Optional Labels 87

The break Statement 88

The continue Statement 90

Summary 92

Exam Essentials 92

Review Questions 94

Chapter 3 Core Java APIs 101

Creating and Manipulating Strings 102

Concatenation 102

Immutability 104

The String Pool 105

Important String Methods 105

Method Chaining 110

Using the StringBuilder Class 111

Mutability and Chaining 112

Creating a StringBuilder 113

Important StringBuilder Methods 114

StringBuilder vs. StringBuffer 117

Understanding Equality 117

Understanding Java Arrays 119

Creating an Array of Primitives 119

Creating an Array with Reference Variables 121

Using an Array 123

Sorting 124

Searching 125

Varargs 126

Multidimensional Arrays 126

Understanding an ArrayList 129

Creating an ArrayList 129

Using an ArrayList 130

Wrapper Classes 134

Autoboxing 136

Converting Between array and List 136

Sorting 138

Working with Dates and Times 138

Creating Dates and Times 138

Manipulating Dates and Times 142

Working with Periods 145

Formatting Dates and Times 148

Parsing Dates and Times 151

Summary 151

Exam Essentials 152

Review Questions 153

Chapter 4 Methods and Encapsulation 165

Designing Methods 166

Optional Specifiers 168

Return Type 169

Method Name 170

Parameter List 171

Optional Exception List 171

Method Body 171

Working with Varargs 172

Applying Access Modifiers 173

Private Access 173

Default (Package Private) Access 175

Protected Access 176

Public Access 180

Designing Static Methods and Fields 181

Calling a Static Variable or Method 182

Static vs. Instance 183

Static Variables 185

Static Initialization 186

Static Imports 187

Passing Data Among Methods 188

Overloading Methods 191

Creating Constructors 196

Default Constructor 197

Overloading Constructors 199

Final Fields 202

Order of Initialization 202

Encapsulating Data 205

Creating Immutable Classes 207

Writing Simple Lambdas 208

Lambda Example 209

Lambda Syntax 211

Predicates 214

Summary 215

Exam Essentials 216

Review Questions 218

Chapter 5 Class Design 233

Introducing Class Inheritance 234

Extending a Class 235

Applying Class Access Modifiers 237

Creating Java Objects 237

Defining Constructors 238

Calling Inherited Class Members 244

Inheriting Methods 246

Inheriting Variables 257

Creating Abstract Classes 259

Defining an Abstract Class 260

Creating a Concrete Class 262

Extending an Abstract Class 263

Implementing Interfaces 266

Defining an Interface 267

Inheriting an Interface 269

Interface Variables 273

Default Interface Methods 274

Static Interface Methods 278

Understanding Polymorphism 279

Object vs. Reference 281

Casting Objects 282

Virtual Methods 284

Polymorphic Parameters 285

Polymorphism and Method Overriding 287

Summary 288

Exam Essentials 289

Review Questions 291

Chapter 6 Exceptions 299

Understanding Exceptions 300

The Role of Exceptions 300

Understanding Exception Types 302

Throwing an Exception 304

Using a try Statement 305

Adding a finally Block 307

Catching Various Types of Exceptions 309

Throwing a Second Exception 311

Recognizing Common Exception Types 313

Runtime Exceptions 314

Checked Exceptions 317

Errors 317

Calling Methods That Throw Exceptions 318

Subclasses 319

Printing an Exception 321

Summary 323

Exam Essentials 324

Review Questions 325

Appendix A Answers to Review Questions 333

Chapter 1: Java Building Blocks 334

Chapter 2: Operators and Statements 336

Chapter 3: Core Java APIs 339

Chapter 4: Methods and Encapsulation 342

Chapter 5: Class Design 346

Chapter 6: Exceptions 349

Appendix B Study Tips 353

Studying for the Test 354

Creating a Study Plan 354

Creating and Running Sample Applications 355

Taking the Test 359

Understanding the Question 359

Applying Process of Elimination 362

Optimizing Your Time 364

Getting a Good Night’s Rest 366

Index 367

Text Correction,Intro mock question #9: there is a stray 'a' after (Choose all that apply) 04/02/15
Text Correction,Intro mock question #9: there is a stray 'a' after (Choose all that apply)05/01/15
IntroductionxxxixErrata in text,Corrections in Book and Online:

In Point number 1:
Currently reads: a_b defaults to a null value
Should read: $ defaults to 0

In Point number 3:
'Puma is invalid' should be 'Cougar is invalid' for the explanation for D

'E is incorrect' should be 'E is correct'

In Point number 4:
The first bullet should say 'starts' rather than 'continues'

'With y taking a new value' should be 'With count taking a new value'

Also, in the second bullet, 1 + 4 should say 1 + 5.
12-Feb-16
IntroductionxliErrata in Text,Point Number 10 currently reads:Reference one points to g1
Should read:Reference two points to g2


Point Number 13 currently reads:D and E are correct
Should read:D and E are incorrect
23-May-16
IntroductionxliiErrata in text,Corrections in Book and Online:

Point number 16:
Currently Reads:
'because an interface may inherit two abstract methods with the same signature'

Should Read:
'because a class may inherit two abstract methods with the same signature'
12-Feb-16
1Chapter 1Errata in text,eBook Correction Only:

In some of the review questions, the line break is missing between the code that would be in different files. You can assume that each package statement starts a new file.
22-Feb-16
14Errata in text,Corrections in Book Only:

'each of these five words is in' should be 'each of these six words is in'
12-Feb-16
18Errata in text,The code currently reads:
Zoo.mainmethod(Zoo.java:7)

Should Read:
Zoo.main(Zoo.java:4)
22-Feb-16
110Errata in text,In the fourth line of the second paragraph, 'From example' should be 'For example'.22-Feb-16
112Errata in text,Corrections in Book Only:

'java.nio.files.Paths' should be 'java.nio.file.Paths'
Note:This change should carried out in two instances
12-Feb-16
118Errata in text,Corrections in Book Only:

The middle code block should have } instead of { on line 5.
12-Feb-16
130Errata in text,The compiler error message at the top of the page should refer to line 7 rather than line 5.22-Feb-16
131Errata in text,At the end of the second paragraph, 'simplest type it can give the value' should be 'simplest value it can give the type'22-Feb-16
253Errata in text,Corrections in Book Only:

On the first line of table 2.1, ~ should be in the other unary operators section. And on the last line of the table, !=, should be |=.
12-Feb-16
254Errata in text,Corrections in Book Only:

In 'resulting in a value of x of 7. Make sure you understand why the result is 24', the 7 should be 14
12-Feb-16
254Errata in text,Corrections in Book Only:

In 'int x = 2 * ((5 + 3) * 4 - 8); This time you would evaluate the addition operator 10 + 3', the 10 should be 5.
12-Feb-16
257Errata in text,Corrections in Book Only:

In the second sentence, 'multiplied' should be 'divided'
12-Feb-16
261Errata in text,Corrections in Book Only:

9l should be 9f on the first row
12-Feb-16
262Errata in text,Corrections in Book Only:

Currently Reads:
The compound operator will first cast x to a long

Should Read:
The compound operator will first cast y to a long
12-Feb-16
264Errata in text,Corrections in Book Only:

Figure 2.1 says 'true tables' rather than 'truth tables'
12-Feb-16
269Errata in text,'block of statement' should be 'block of statements'22-Feb-16
271Errata in text,The first code example shouldn't have 'final' so the ternary operator is equivalent.22-Feb-16
272Errata in text,Corrections in Book Only:

Remove 'As of Java 7' from the first sentence
12-Feb-16
273Text Correction,'int' and 'Integer' is listed twice in the bulleted list. 04/02/15
282Errata in text,Corrections in Book Only:

In the first example on the page, System.out.println(x) should be removed.
12-Feb-16
282Errata in text,Corrections in Book Only:

In the first example, 'y and z were both long' should be 'In the multiple terms example, y and z were both long'
12-Feb-16
283Errata in text,Corrections in Book Only:

Figure 2.8 says 'semicolon' rather than 'colon' when pointing to a colon
12-Feb-16
283Errata in text,Corrections in Book Only:

In Figure 2.8, the title should be 'enhanced for-each statement' rather than 'enhancement for statement'
12-Feb-16
286Errata in text,Corrections in Book Only:

values[i]-values[i-1] should be (values[i]-values[i-1]) + ,
12-Feb-16
291Errata in text,Corrections in Book Only:

In table 2.5, the second table header should be 'Allows unlabeled break'
12-Feb-16
296Errata in text,Corrections in Book and Online:

In Point number 8:
Choice E should be changed to 'None of the above'
12-Feb-16
3107Errata in text,Corrections in Book Only:

int indexOf(char ch) should be int indexOf(int ch)

and

int indexOf(char ch, index, fromIndex) should be int indexOf(int ch, int fromIndex)

int indexOf(String str, index fromIndex) should be int indexOf(String str, int fromIndex).
12-Feb-16
3107Errata in text,Corrections in Book Only:

'int substring' should be 'String substring' in both substring methods
12-Feb-16
3108Errata in text,Corrections in Book Only:

Currently reads: toLowerCase(String str)
Should read: toLowerCase()


Currently Reads: toUpperCase(String str)
Should Read: toUpperCase()
12-Feb-16
3108Errata in text,Corrections in Book Only:

Currently Reads:
because the indexes can be backward

Should Read:
because the indexes can't be backward
12-Feb-16
3109Errata in text,Corrections in Book Only:

boolean equals(String str) should be boolean equals(Object obj)
Note: You only have to know about String for the exam
12-Feb-16
3111Text Correction,Currently reads:
Animal
Should read:
AnimAl
05/01/15
3111Errata in text,Corrections in Book Only:

In the third paragraph, there is a stray quote. 'C' should be 'C'
12-Feb-16
5115Errata in text,Corrections in Book Only:

On line 6, the line should have a dash at the end
12-Feb-16
3118Errata in text,Corrections in Book Only:

In the code example, line 7 should have been t1 == t3.
12-Feb-16
3120Errata in text,Corrections in Book Only:

On the first line, 'set all the elements' should be 'all elements are set'
12-Feb-16
3124Errata in text,Corrections in Book Only:

import java.util.* should be import java.util.*;
12-Feb-16
3124Errata in text,Currently Reads:
Using the length variable

Should Read:
using the length field
12-Feb-16
3124Errata in text,Currently Reads:
\ L System.out.print

Should Read:
System.out.print
12-Feb-16
3125Errata in text,Corrections in Book Only:

In the last paragraph, 'line 5 searches for the index of 1' should be 'line 6'
12-Feb-16
3126Errata in text,Corrections in Book Only:

In the first paragraph, 'line 3 gave the wrong answer' should be line 7.
12-Feb-16
3126Errata in equation,Corrections in Book Only:

int numbers = should be int[] numbers =
12-Feb-16
3126Errata in text,Corrections in Book Only:

In the last paragraph of the Autoboxing section, 'outputs 1' should be 'outputs[1]'
12-Feb-16
3129Errata in equation,Corrections in Book Only:

import java.util.* should be import java.util.*;
12-Feb-16
3141Errata in text,Corrections in Book Only:

Currently Reads:
public static LocalDateTime of(LocalDate date, LocalTime)

Should Read:
public static LocalDateTime of(LocalDate date, LocalTime time)
12-Feb-16
3141Errata in text,Corrections in Book Only:

Month.January, 32) should be Month.January, 32);
12-Feb-16
3143Errata in text,Corrections in Book Only:

LocalDateTime.of(date2 should be LocalDateTime.of(date
12-Feb-16
3146Errata in text,Corrections in Book Only:

toEpochTime should to toEpochSecond
12-Feb-16
3147Errata in text,Corrections in Book Only:

Currently Reads:
wrong = Period.ofWeeks(7);

Should Read:
wrong = Period.ofWeeks(1);
12-Feb-16
3148Errata in text,Corrections in Book Only:

System.out.println(date.format(DateTimeFormatteer.ISO_LOCAL_DATE)); should have a line break immediately before System
12-Feb-16
3150Errata in text,Corrections in Book Only:

'dd means to include the leading zero for a single-digit month' should be 'dd means to include the leading zero for a single-digit day'
12-Feb-16
4168Errata in text,Corrections in Book Only:

'And since it is optional, you can't have any of them at all.' should be 'And since it is optional, you are allowed to not have any of them at all.'
12-Feb-16
4170Errata in text,Corrections in Book Only:

Currently Reads:
int long() {]

Should Read:
int longMethod(){
12-Feb-16
4172Errata in text,Corrections in Book Only:

Currently Reads:
Walk1() is a valid method declaration without an empty method body.

Should Read:
Walk1() is a valid method declaration with an empty method body.
12-Feb-16
4172Errata in text,Corrections in Book Only:

Currently Reads:
public void walk2;

Should Read:
public void walk2();
12-Feb-16
4173Errata in text,Corrections in Book Only:

Currently Reads:
Line 20 calls a vararg parameter two parameters

Should Read:
Line 20 calls a vararg method with two parameters.
12-Feb-16
4179Errata in text,'Bird is not a subclass of Bird' should say 'Bird is not a subclass of Goose'22-Feb-16
4184Errata in text,Corrections in Book Only:

Currently Reads:
public static average

Should Read:
public static double average
12-Feb-16
4184Errata in text,Corrections in Book Only:

In Table 4.3, the empty 'How?' cell should be 'Not without instantiating the object'
12-Feb-16
4188Errata in text,Corrections in Book Only:

Currently Reads:
4: newNumber(5)

Should Read:
4: newNumber(num)
12-Feb-16
4191Errata in text,Corrections in Book Only:

In the third paragraph, fifth sentence, 'numbers' should be 'number'
12-Feb-16
4191Errata in text,Corrections in Book Only:

In the first sentence of the overloading methods section, it should say 'same name' not 'same signature'
12-Feb-16
4192Errata in text,Corrections in Book Only:

Currently Reads:
everything other than the method signature can vary for overloaded methods

Should Read:
everything other than the method name can vary for overloading methods
12-Feb-16
4192Errata in text,Corrections in Book Only:

Currently Reads:
public void fly(int numMiles) { System.out.println( short );

Should Read:
public void fly(int numMiles) { System.out.println( int );
12-Feb-16
4194Errata in text,Insert spaces after the answer text, preferably using double quotes, such as:
     [Start of First paragraph]     The answer is  string object   
[Start of Third paragraph] The answer is int long .
[Middle of Third paragraph] parameter list, the output becomes long long .

(Note the spaces before the second double quotes in each of the three corrections.)
12-Feb-16
4199Errata in text,Corrections in Book Only:

Currently Reads:
When overloading methods, the method name and parameter list needed to match.

Should Read:
When overloading methods, the method name needs to match
12-Feb-16
4203Errata in text,Corrections in Book Only:

In the third sentence 'lines 4 and 5' should be 'lines 4, 5 and 6' when referring to the static initializer
12-Feb-16
4204Errata in text,Corrections in Book Only:

After 'output Torchie.', it should say 'Line 6 then outputs 1.'
12-Feb-16
4206Errata in text,Corrections in Book Only:

In Table 4.5, 'Getter methods begin with is if the property is a boolean', should be 'Getter methods begin with is or get if the property is a boolean'

'Line 14 doesn't follow the JavaBeans naming conventions. Since playing is a boolean, the getter must begin with is' should be 'Line 14 is correct. SInce playing is a boolean, getter is allowed to begin with get or is'
12-Feb-16
4209Errata in text,Corrections in Book Only:

'that that' has a duplicate word on the seventh line
12-Feb-16
4210Errata in text,Corrections in Book Only:

Currently Reads:
1: public class TraditionalSearch

Should Read:
1: import java.util.*; public class TraditionalSearch
12-Feb-16
4211Errata in text,Corrections in Book Only:

'Java replies' should be 'Java relies'.
12-Feb-16
4211Errata in text,Corrections in Book Only:

a -> a.canHop(); should be a -> a.canHop()
12-Feb-16
4213Errata in text,Corrections in Book Only:

'Lambdas are allowed to access variables' is in the real world scenario twice. The first sentence should be removed.
12-Feb-16
4216Errata in text,Corrections in Book Only:

In the summary section, (a -> a.equals(b) has an extra open paren. It should be a-> a.equals(b)
12-Feb-16
4219Errata in text,Corrections in Book and Online:

In Point number 7:
'ClassRoom' should be 'Classroom'
In the line 6, Mrs. Anderson should be Mrs. Anderson
12-Feb-16
4222Errata in text,Corrections in Book and Online:

In Point number 11:
Answers D and E should have an extra space at the end
12-Feb-16
4226Errata in text,Corrections in Book and Online:

In Point number 19:
In the choice G, the closing } is missing
12-Feb-16
4229Errata in text,Corrections in Book and Online:

In Point number 25:
Answers A through D should have an extra space at the end
12-Feb-16
4229Errata in text,In Point number 25:
1000L should be 100L. This does not affect the correct answer.
22-Feb-16
5237Errata in text,In the first paragraph after the note, second sentence:
Remove subclass or in the sentence.

Updated sentence should read as:
The default package private modifier, which is the lack of any access modifier, indicates the class can be accessed only by a class within the same package
25-Feb-16
5239Errata in text,Corrections in Book Only:

'user' should be 'use' in 'Notice the user of both super() and super(age)'
12-Feb-16
5246Errata in text,Corrections in Book Only:

a method a method should be a method
12-Feb-16
5247Errata in text,Corrections in Book Only:

The numbers output should be 50.0 and 70.0, not 50.00 and 70.00
12-Feb-16
5249Errata in text,Corrections in Book Only:

'The return type void is not a subclass of int' is reversed. Swap int and void in the sentence
12-Feb-16
5249Errata in text,In the last paragraph, 'on the example' should be 'on the exam'22-Feb-16
249Errata in Text,Currently reads:'constructor to a constructor'
Should read: 'method to a method'
23-May-16
5254Errata in text,Corrections in Book Only:

ParentClassName.method() should be super.method()
12-Feb-16
5261Errata in text,Corrections in Book Only:

In the first sentence, 'brackets' should be 'braces'.
12-Feb-16
5263Errata in text,The second to last sentence in the second paragraph should read 'The key point is that the first concrete class to extend the abstract class must implement all inherited abstract metthods'.22-Feb-16
5265Errata in text,In the First numbered list entitled Abstract Class Definition Rules , item #3:

Add 'protected' to the list of items in the sentence.
The words, private/protected/final - should use Inline Code font.


Updated sentence should read as:

Abstract classes may not be marked as private, protected, or final.
25-Feb-16
5267Errata in text,Corrections in Book Only:

Point number 4 should be - All top-level interfaces areassumed to have public or default access. They are assumed to be abstract whether this keyword is used or not. Therefore, making a method private, protected or final will trigger a compiler error as it is incompatible with these assumptions.
12-Feb-16
5269Errata in text,Corrections in Book Only:

'using the extend keyword' should be 'using the extends keyword'
12-Feb-16
5272Errata in text,Corrections in Book Only:

The second Bear class should have //DOES NOT COMPILE on line 1 as well.
12-Feb-16
5274Errata in text,Corrections in Book Only:

'The compile will' should be 'The compiler will'
12-Feb-16
5276Errata in text,Corrections in Book Only:

At the bottom of the page, 'the following class' should say 'the following interface'
12-Feb-16
5285Errata in text,Corrections in Book Only:

At the bottom of the page, the coding 'Feeding reptile' should be 'Feeding:'
12-Feb-16
5291Errata in text,Corrections in Book and Online:

In Point number 2:
Choice E should reference line 7, not line 8
12-Feb-16
5294Errata in text,Corrections in Book and Online:

In Point number 10:
In choice C, 'extend' should be 'extends'
12-Feb-16
5295Errata in text,Corrections in Book and Online:

In Point number 13:
The { is missing on line 1 of the provided code
12-Feb-16
301Errata in Text,Currently reads:'at mainmethod.Zoo.main(Zoo.java:7)'
Should read: 'at Zoo.main(Zoo.java:4)'
23-May-16
6312Errata in text,Corrections in Book Only:

There aren't any, so the main method throws that new exception should be This exception is caught on line 23.
12-Feb-16
6313Errata in text,Corrections in Book Only:

Lines 35, 37 and 42 should have a space before the final quote on the line
12-Feb-16
6314Errata in text,Corrections in Book Only:

In the ClassCastException section, 'cast an exception to a subclass' should be 'cast an object to a subclass'
12-Feb-16
6317Errata in text,Corrections in Book Only:

'Common runtime exceptions' should be 'Common checked exceptions'
12-Feb-16
335Errata in text,Corrections in Book and Online:

In Point number 14:
In the explanation currently reads:
'Option B is incorrect because package names are case sensitive'

Should read:
'Option C is incorrect because package names are case sensitive'
12-Feb-16
338Errata in text,In Point number 14:
In the explanation currently reads:
'The value of result is computed by adding 4 to the original value of 8'

Should Read:
'The value of result is computed by adding 8 to the original value of 4'


In Point number 18: The answer should be B (not A)
12-Feb-16
338Errata in text,Corrections in Book and Online:

Corrections in Book and Online:

In Point number 17:
The explanation should say 'keep going remains true' rather than 'keep going is false'
12-Feb-16
339Errata in text,Corrections in Book and Online:

In Point number 2:
The explanation should say 'Line 8 also compares references but is true since both references point to the object from the string pool. Finally, line 9 compares one object from the string pool with one that was explicitly constructed and returns false.'
12-Feb-16
340Errata in text,Corrections in Book and Online:

In Point number 10:
The explanation should say 'The if statement on line 18 returns true because' rather than 'The if statement on line 18 returns true'


In Point number 4:
In the explanation, abbbaa has an extra b. There should only be two b's.
12-Feb-16
341Errata in text,Corrections in Book and Online:

In Point number 14:

The explanation should say 'Option B does not reverse the string' rather than 'Option B is a nice distraction resulting avaJ'

The explanation should say 'starting with 0' rather than 'starting with 1'
12-Feb-16
342Errata in text,Corrections in Book and Online:

In Point number 26:
The explanation should say 'The code does compile' rather than 'The code does not compile'
12-Feb-16
Appendix A344Errata in text,Corrections in Book and Online:

In Point number 9:

A,C,E. Options B and D are incorrect because they don't follow the naming convention of beginning with get/is/set. Options C and E follow normal getter and setter conventions. Option A is correct, but the book doesn't explain this and is out of scope for the exam so give yourself credit if you answered C and E.


Note: The 'get/is/set' within the explanation should be styled as Inline Code.
12-Feb-16
344Errata in text,Corrections in Book and Online:

In Point number 10:
should say 'swing ' instead of 'swing' (missing space)
12-Feb-16
344Errata in text,Corrections in Book and Online:

We autobox to objects so it should say 'can be autoboxed to a Boolean' rather than 'boolean' and 'autoboxed to a Double' rather than 'double'
12-Feb-16
344Errata in text,Corrections in Book and Online:

In Point number 17:
'pass by reference' should be 'pass by value'
12-Feb-16
345Errata in text,Corrections in Book and Online:

In Point number 23:
In the explanation, 'created on line 4' should be 'created on line 12' and 'created on line 5' should be 'created on line 13'
12-Feb-16
346Errata in text,Corrections in Book and Online:

In Point number 2:
The last sentence of the explanation should be removed
12-Feb-16
347Errata in text,Corrections in Book and Online:

In Point number 8:
In the first sentence of the explanation, 'public and static' should be 'public, static and final'
12-Feb-16
347Errata in text,Corrections in Book and Online:

In Point number 3:
'CanHope' should be 'CanHop'
12-Feb-16
348Errata in text,Corrections in Book and Online:

In Point number 18:
In the explanation, 'since int is not a subclass of String' should be 'since String is not a subclass of int'
12-Feb-16
350Errata in text,Corrections in Book and Online:

In Point number 8:
'try try' should be 'the try'
12-Feb-16