首页 OCA Study Guide Errata
文章
取消

OCA Study Guide Errata

ERRATA

ChapterPageDetails
   
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.
   
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
   
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’
   
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.
   
14Errata in text Corrections in Book Only: ‘each of these five words is in’ should be ‘each of these six words is in’
   
18Errata in text The code currently reads: Zoo.mainmethod(Zoo.java:7) Should Read: Zoo.main(Zoo.java:4)
   
110Errata in text In the fourth line of the second paragraph, ‘From example’ should be ‘For example’.
   
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
   
118Errata in text Corrections in Book Only: The middle code block should have } instead of { on line 5.
   
130Errata in text The compiler error message at the top of the page should refer to line 7 rather than line 5.
   
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’
   
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 |=.
   
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
   
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.
   
257Errata in text Corrections in Book Only: In the second sentence, ‘multiplied’ should be ‘divided’
   
261Errata in text Corrections in Book Only: 9l should be 9f on the first row
   
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
   
264Errata in text Corrections in Book Only: Figure 2.1 says ‘true tables’ rather than ‘truth tables’
   
269Errata in text ‘block of statement’ should be ‘block of statements’
   
271Errata in text The first code example shouldn’t have ‘final’ so the ternary operator is equivalent.
   
272Errata in text Corrections in Book Only: Remove ‘As of Java 7’ from the first sentence
   
273Text Correction ‘int’ and ‘Integer’ is listed twice in the bulleted list.
   
282Errata in text Corrections in Book Only: In the first example on the page, System.out.println(x) should be removed.
   
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’
   
283Errata in text Corrections in Book Only: Figure 2.8 says ‘semicolon’ rather than ‘colon’ when pointing to a colon
   
283Errata in text Corrections in Book Only: In Figure 2.8, the title should be ‘enhanced for-each statement’ rather than ‘enhancement for statement’
   
286Errata in text Corrections in Book Only: values[i]-values[i-1] should be (values[i]-values[i-1]) + “,”
   
291Errata in text Corrections in Book Only: In table 2.5, the second table header should be ‘Allows unlabeled break’
   
296Errata in text Corrections in Book and Online: In Point number 8: Choice E should be changed to ‘None of the above’
   
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).
   
3107Errata in text Corrections in Book Only: ‘int substring’ should be ‘String substring’ in both substring methods
   
3108Errata in text Corrections in Book Only: Currently reads: toLowerCase(String str) Should read: toLowerCase() Currently Reads: toUpperCase(String str) Should Read: toUpperCase()
   
3108Errata in text Corrections in Book Only: Currently Reads: because the indexes can be backward Should Read: because the indexes can’t be backward
   
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
   
3111Text Correction Currently reads: Animal Should read: AnimAl
   
3111Errata in text Corrections in Book Only: In the third paragraph, there is a stray quote. “‘C’ should be ‘C’
   
5115Errata in text Corrections in Book Only: On line 6, the line should have a dash at the end
   
3118Errata in text Corrections in Book Only: In the code example, line 7 should have been t1 == t3.
   
3120Errata in text Corrections in Book Only: On the first line, ‘set all the elements’ should be ‘all elements are set’
   
3124Errata in text Corrections in Book Only: import java.util.* should be import java.util.*;
   
3124Errata in text Currently Reads: Using the length variable Should Read: using the length field
   
3124Errata in text Currently Reads: \ L System.out.print Should Read: System.out.print
   
3125Errata in text Corrections in Book Only: In the last paragraph, ‘line 5 searches for the index of 1’ should be ‘line 6’
   
3126Errata in text Corrections in Book Only: In the first paragraph, ‘line 3 gave the wrong answer’ should be line 7.
   
3126Errata in equation Corrections in Book Only: int numbers = should be int[] numbers =
   
3126Errata in text Corrections in Book Only: In the last paragraph of the Autoboxing section, ‘outputs 1’ should be ‘outputs[1]’
   
3129Errata in equation Corrections in Book Only: import java.util.* should be import java.util.*;
   
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)
   
3141Errata in text Corrections in Book Only: Month.January, 32) should be Month.January, 32);
   
3143Errata in text Corrections in Book Only: LocalDateTime.of(date2 should be LocalDateTime.of(date
   
3146Errata in text Corrections in Book Only: toEpochTime should to toEpochSecond
   
3147Errata in text Corrections in Book Only: Currently Reads: wrong = Period.ofWeeks(7); Should Read: wrong = Period.ofWeeks(1);
   
3148Errata in text Corrections in Book Only: System.out.println(date.format(DateTimeFormatteer.ISO_LOCAL_DATE)); should have a line break immediately before “System”
   
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’
   
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.’
   
4170Errata in text Corrections in Book Only: Currently Reads: int long() {] Should Read: int longMethod(){
   
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.
   
4172Errata in text Corrections in Book Only: Currently Reads: public void walk2; Should Read: public void walk2();
   
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.
   
4179Errata in text ‘Bird is not a subclass of Bird’ should say ‘Bird is not a subclass of Goose’
   
4181Errata in text Table 4.2 INCORRECT: superclass CORRECT: subclass
   
4184Errata in text Corrections in Book Only: Currently Reads: public static average Should Read: public static double average
   
4184Errata in text Corrections in Book Only: In Table 4.3, the empty ‘How?’ cell should be ‘Not without instantiating the object’
   
4188Errata in text Corrections in Book Only: Currently Reads: 4: newNumber(5) Should Read: 4: newNumber(num)
   
4191Errata in text Corrections in Book Only: In the third paragraph, fifth sentence, ‘numbers’ should be ‘number’
   
4191Errata in text Corrections in Book Only: In the first sentence of the overloading methods section, it should say ‘same name’ not ‘same signature’
   
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
   
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”);
   
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.)
   
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
   
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
   
4204Errata in text Corrections in Book Only: After ‘output Torchie.’, it should say ‘Line 6 then outputs 1.’
   
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’
   
4209Errata in text Corrections in Book Only: ‘that that’ has a duplicate word on the seventh line
   
4210Errata in text Corrections in Book Only: Currently Reads: 1: public class TraditionalSearch Should Read: 1: import java.util.*; public class TraditionalSearch
   
4211Errata in text Corrections in Book Only: ‘Java replies’ should be ‘Java relies’.
   
4211Errata in text Corrections in Book Only: a -> a.canHop(); should be a -> a.canHop()
   
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.
   
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)
   
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”
   
4222Errata in text Corrections in Book and Online: In Point number 11: Answers D and E should have an extra space at the end
   
4226Errata in text Corrections in Book and Online: In Point number 19: In the choice G, the closing } is missing
   
4229Errata in text In Point number 25: 1000L should be 100L. This does not affect the correct answer.
   
4229Errata in text Corrections in Book and Online: In Point number 25: Answers A through D should have an extra space at the end
   
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”
   
5239Errata in text Corrections in Book Only: ‘user’ should be ‘use’ in ‘Notice the user of both super() and super(age)’
   
5246Errata in text Corrections in Book Only: “a method a method” should be “a method”
   
5247Errata in text Corrections in Book Only: The numbers output should be 50.0 and 70.0, not 50.00 and 70.00
   
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
   
5249Errata in text In the last paragraph, ‘on the example’ should be ‘on the exam’
   
 249Errata in Text Currently reads:’constructor to a constructor’ Should read: ‘method to a method’
   
5254Errata in text Corrections in Book Only: ParentClassName.method() should be super.method()
   
5261Errata in text Corrections in Book Only: In the first sentence, ‘brackets’ should be ‘braces’.
   
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’.
   
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.”
   
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.
   
5269Errata in text Corrections in Book Only: ‘using the extend keyword’ should be ‘using the extends keyword’
   
5272Errata in text Corrections in Book Only: The second Bear class should have //DOES NOT COMPILE on line 1 as well.
   
5274Errata in text Corrections in Book Only: ‘The compile will’ should be ‘The compiler will’
   
5285Errata in text Corrections in Book Only: At the bottom of the page, the coding ‘Feeding reptile’ should be ‘Feeding:’
   
5276Errata in text Corrections in Book Only: At the bottom of the page, ‘the following class’ should say ‘the following interface’
   
5291Errata in text Corrections in Book and Online: In Point number 2: Choice E should reference line 7, not line 8
   
5294Errata in text Corrections in Book and Online: In Point number 10: In choice C, ‘extend’ should be ‘extends’
   
5295Errata in text Corrections in Book and Online: In Point number 13: The { is missing on line 1 of the provided code
   
 301Errata in Text Currently reads:’at mainmethod.Zoo.main(Zoo.java:7)’ Should read: ‘at Zoo.main(Zoo.java:4)’
   
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.”
   
6313Errata in text Corrections in Book Only: Lines 35, 37 and 42 should have a space before the final quote on the line
   
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’
   
6317Errata in text Corrections in Book Only: ‘Common runtime exceptions’ should be ‘Common checked exceptions’
   
 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’
   
 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)
   
 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’
   
 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.’
   
 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.
   
 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’
   
 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’
   
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.
   
 344Errata in text Corrections in Book and Online: In Point number 10: should say ‘swing ‘ instead of ‘swing’ (missing space)
   
 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’
   
 344Errata in text Corrections in Book and Online: In Point number 17: ‘pass by reference’ should be ‘pass by value’
   
 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’
   
 346Errata in text Corrections in Book and Online: In Point number 2: The last sentence of the explanation should be removed
   
 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’
   
 347Errata in text Corrections in Book and Online: In Point number 3: ‘CanHope’ should be ‘CanHop’
   
 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’
   
 350Errata in text Corrections in Book and Online: In Point number 8: ‘try try’ should be ‘the try’
   

作者博客的非官方Errata

作者的博客也有个页面维护了包括WILEY官方和读者提供的非官方Errata,地址在 https://www.selikoff.net/java-oca-8-programmer-i-study-guide/

本文由作者按照 CC BY 4.0 进行授权