Вы находитесь на странице: 1из 3

SCJP 5 - Errata 7/28/06

(New since April marked with an * after the page number)

page...type......description

..9....clarify...Listener methods must end in "Listener"

.14.*..bug.......2nd para. was: Apart from using...in Chapter 10, you can do one of...
...........................s/b: You can do one of two things...

.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

.61.*..bug.......Middle para. s/b: The key point to remember is that an enum that
isn't enclosed in a class, can be...

.62.*..bug.......After first code s/b: ...of the enum declaration, when no other
declarations for this enum follow
&65....clarify...comment in code s/b: ...REQUIRED when more code follows

.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.

217.*..typo......figure 3-4, myDogs(0) s/b: myDogs[0]

229.*..clarify...2nd to last para.: Non-"true" String constructors equate to "false"

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);

235.*..typo......2nd para. "So, under the covers..." was: "i++", s/b: "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.

240.*..typo......Para. after "Byte, Byte", 1t sentence, "int" s/b "byte".

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"

507.*..bug.......F & G, replace "override" with "implement" and in the answer for A,
B, D, and E:
& 520............s/b: ...you don't implement the defaultReadObject() method, you call
it from within the readObject() method...

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 <E extends Number> List<E> process(List<E> nums)

631....bug.......A-13, end of answer s/b: are not defined in the Arrays or Collections
classes. (Objective 6.5)

649.*..bug.......Last sentence in exam watch s/b: It's rare to see semicolons


following curly braces.

665.*..clarify...Answer 1, B, remove the sentence beginning: When you instantiate a


nested...

669....typo......Answer s/b: A,B,D,E, and F are incorrect

682.*..bug.......In exam watch, code s/b: Thread t = new Thread(); t.run();

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.

meetthe2klion@yahoo.com

Вам также может понравиться