SCJP 5 - Errata 4/16/06 SCJP Sun Certified Programmer for Java 5 Study Guide (Exam 310-055) Sierra & Bates 0072253606 page...type......description ..9....clarify...Listener methods must end in "Listener" .41....typo......2nd declaration s/b: final int recordNumber .45....x-ref.....Synchronized para. s/b: Chapter 9 .59....x-ref.....Volatile para. s/b: Chapter 9 .74....bug.......Q-2: answers A-D were: public Bark speak()... & 77...............................s/b: public void speak()... .94....clarify...code was: private Halter myHalter; ......................s/b: private Halter myHalter = new Halter(); 115....clarify...last sentence before exam watch s/b: If any superclass in its inheritance tree has already provided concrete (i.e., non-abstract) method implementations, then, regardless of whether the superclass declares that it implements the interface, the subclass is under no obligation to re-implement (override) those methods. 115....bug.......exam watch was: a.doDogStuff(); ............................s/b: d.doDogStuff(); 133....bug.......3rd row, 2nd column was: class Foo { .....................................s/b: public class Foo { 174....clarify...line 15 s/b: dog.setName("Aiko"); 216....bug.......Starting at 2nd sentence "As we'll cover..." remove that sentence and the code down to the next heading. 233....bug.......In table 3-3, valueOf for Boolean does not throw NFE 234....bug.......1st two S.o.p.'s s/b: ("y = " + y); 236....clarify...Sentence before bullet points s/b: In order to save memory, two instances of the following wrapper objects, created through autoboxing, will always be equal... 236....clarify...Add this sentence: When == is used to compare a primitive to a wrapper object, the wrapper object will be unwrapped to its primitive value, and the comparison will be made between the two primitives' values. 258....clarify...2nd boxing bullet s/b: Using == with wrappers created through autoboxing is tricky; those with small values... 259....clarify...Q-2: code s/b: Short story = 200; & 266 322....clarify...Near the bottom of the exam watch, sentence s/b: But the only variables that can be assigned (rather than tested against something else) are a boolean or a Boolean; all other... 364....typo......code: doStuff() s/b: doStuff(); 370....x-ref.....3rd row (IllegalArgumentException) s/b: (This chapter) .................6th row (NumberFormatException) s/b: (Chapter 3, "Assignments") 381....bug.......code s/b: switch(x) { case 2: y = 3; break; case 3: y = 9; break; case 4: y = 27; break; default: assert false; // we're never supposed to get here } 421....typo...... bottom of page, s/b: x+= " ocean"; 439....bug.......2nd 2. s/b: Create a Writer or a Stream. Specifically, create a FileWriter, a PrintWriter, or a FileOutputStream. 454....bug.......2nd paragraph s/b: ...(unless you implement readObject())... 472....bug......."Finding stuff" bullet, last sentence s/b: We'll use the java.util.regex.Pattern , java.util.regex.Matcher, and java.util.Scanner classes to help us find stuff. 492....bug.......Last paragraph s/b: ...and to deserialize an object invoke readObject(). 497....bug.......6th bullet: was matcher() s/b: matches() 505....typo......top of page: was: "dir1" and "dir1" & 517.........................s/b: "dir1" and "dir2" 528....typo......2nd line: moofvalue() s/b: getMoofValue() 538....bug.......In figure, LinkedHashMap s/b a subclass of HashMap 562....bug.......After big code listing, s/b: ...not predictable: HashSets do not guarantee any ordering. 574....big bug...The top 2/3 of the page uses a HashSet / Set example. It should be using an ArrayList / List example, so replace 10 occurrences of "Set" with "List", and replace 2 occurrences of "HashSet" with "ArrayList". 581....clarify...Exam watch should be: ...even if that Object reference refers to an Integer (or some other wrapper object) on the heap. 620....bug.......Q-16: method declaration s/b: & 634 public static List process(List nums) 631....bug.......A-13, end of answer s/b: are not defined in the Arrays or Collections classes. (Objective 6.5) 669....typo......Answer s/b: A,B,D,E, and F are incorrect 711....x-ref.....item 5 s/b: ...Chapter 6... 752....bug.......Answers 13 & 17: IllegalThreadStateException s/b: & 757 IllegalMonitorStateException 783....clarify...Q-4, D. s/b: D. _A. & 792 787....bug.......Q-10, This is really a question about java, not javac. 796 & 797........Change all references from javac to java.