This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes JavaRanch Exclusive!  temporary K&B 5 errata Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic
Author

JavaRanch Exclusive! temporary K&B 5 errata

Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8815
    
    5
Hi guys,

Haven't got this up on the website yet, but here's the current errata for the K&B SCJP 5 book. If I've missed any let me know in this thread, or better yet in an email!

hth,

Bert



[ March 01, 2006: Message edited by: Bert Bates ]

Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
jothi devika
Greenhorn

Joined: Feb 28, 2006
Posts: 6
Bert

I purchased the book last week.The information which you hav posted wil be useful me.

The K&B book is very nice.
Thanks a lot for ur wonderful work.

warm regards
devika
Sayan Bhattacharya
Greenhorn

Joined: Feb 26, 2006
Posts: 15
Great Bert!thanks a lot!!
Edisandro Bessa
Ranch Hand

Joined: Jan 19, 2006
Posts: 584
Hi Bert,

I think there's one more errata to our list. I've just sent an email too.

Chapter 9, Page 711, Paragraph 5th

Original Statement :
5. Within the block, output the StringBuffer 100 times and then increment
the letter in the StringBuffer. You can check Chapter 5 for StringBuffer
methods that will help with this.

Replaced one :
5. Within the block, output the StringBuffer 100 times and then increment
the letter in the StringBuffer. You can check Chapter 6 for StringBuffer methods that will help with this.


Chapter 5 no longer mention StringBuffer or StringBuilder objects.


"If someone asks you to do something you don't know how to, don't tell I don't know, tell I can learn instead." - Myself
Graham Walsh
Greenhorn

Joined: Mar 08, 2006
Posts: 23
Hi,

I've got the 1.4 book (darn, I should have got the 1.5!). Where can I find errata for the 1.4 book?

thanks much

GrahamO
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Originally posted by Graham Walsh:
Hi,

I've got the 1.4 book (darn, I should have got the 1.5!). Where can I find errata for the 1.4 book?

thanks much

GrahamO


K & B 1.4 errata


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Michael Creech
Greenhorn

Joined: Jan 22, 2006
Posts: 19
Here is some more errata I've compiled that weren't listed:

p.45, Synchronized Methods, "We'll discuss this nearly to death in
Chapter 11"-->"We'll discuss this nearly to death in
Chapter 9" [there is no chapter 11]

p. 175, figure 3-1, String object "Aiko"-->"Fido"

p.253 "...don't put any essential code into your finalize()"-->same
text but font for 'f' in finalize fixed to be same as rest of the
word

p.258 "Using == with wrappers is tricky; wrappers with the same small
values (typically lower than 127), will be ==, larger values will
not be ==." --> this is only true for *boxed* wrappers and ones
lower then 128.

p322, Exam Watch, "But the only variable that can be assigned (rather
than tested against something else) is a boolean; all other
assignments will result in something non-boolean, so they're not
legal..."

This may be precisely true, but somewhat misleading in that
Boxing adds a bit on this since:

Boolean boo = false;
if (boo = true) {} *will* compile and execute.

p441, "Take special note of the what the readline() method
returns."-->"Take special note of what the readline() method
returns."

p492, under Serialization, "The key method you invoke to serialize an
object is writeObject(), and to deserialize an object invoke
readMethod()." --> change readMethod() with readObject().

p497, "You should understand the Pattern compile() method and the
Matcher matcher(),...--> change matcher() to matches()

p513, #7, alternate solution is to have 'try' moved down to just
enclose 'file.createNewFile();', since mkdir() doesn't throw
any checked exception.

p562, "It's important to know that the order of objects printed in the
second for loop is not prdictable: HashSets and LinkedHashSets
do not guarantee any ordering."

I believe this is incorrect about LinkedHashSets, which
guarantee ordering by insertion order.


SCJP1.4, SCJP1.5
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

page 364 , you missed a semicolon when calling doStuff()


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Kristian Perkins
Ranch Hand

Joined: Mar 27, 2006
Posts: 32
Here is a couple of things I found:

page 233 in the table Boolean.valueOf(String) is listed as throwing a NumberFormatException but it does not (only the instances of java.lang.Number throw NFE).

page 439 There are two ways to create a file: point 2 states that FileReader and FileInputStream will create a file if it doesn't exist. This is incorrect, these classes will throw a FileNotFoundException if the file does not exist.

Kristian
[ April 10, 2006: Message edited by: Kristian Perkins ]
Kristian Perkins
Ranch Hand

Joined: Mar 27, 2006
Posts: 32
Sorry to say I have a couple more:

page 216: The second code sample under the section "Initializing Elements in a Loop" shows:
is incorrect in regard to initialising the myDogs array. New Dog objects will be created, but they will be thrown away and all elements in the array will remain null (I know because I have been bitten by this before).

page 370: Chapter locations of some of the Exception types seem to be off, i.e. NumberFormatException is in chapter 3 not 6, IllegalArgumentException in chapter 5 not 3, IllegalStateException I couldn't find and NoClassDefFoundError is hinted at in chapter 10 such as pg. 768 "... javac complains that it can't find a class ..." but doesn't mention NoClassDefFoundError specifically.

By the way, this book is full of great content for the 1.5 exam and is highly recommended.

Kristian
[ April 10, 2006: Message edited by: Kristian Perkins ]
Djoga Djogov
Greenhorn

Joined: Mar 28, 2006
Posts: 5
Hi Kristian,
Why will the new Dog objects be thrown away and not assigned to the array elements? Please explain it.
Kristian Perkins
Ranch Hand

Joined: Mar 27, 2006
Posts: 32
with the for each loop, you don't have direct access to the array references, you only have a copy of the references in the array so you cannot change the original Object references inside the array.
the previous code is equivalent to this:


The for each loop can't change the reference of the array elements, where as the old style for loop listed here can (because you have direct access to manipulate each reference in turn through myDogs[i] = new Dog()).

Hope that helps.
Kristian
Higgledy Smith
Ranch Hand

Joined: Mar 07, 2006
Posts: 192
Originally posted by Kristian Perkins:
with the for each loop, you don't have direct access to the array references, you only have a copy of the references in the array so you cannot change the original Object references inside the array.
the previous code is equivalent to this:


The for each loop can't change the reference of the array elements, where as the old style for loop listed here can (because you have direct access to manipulate each reference in turn through myDogs[i] = new Dog()).

Hope that helps.
Kristian


Kristian,
Is this because in a "for each" loop you are really using the some iterator method that has a type Dog? And as you stated not really access the reference to the Dog Array?
Djoga Djogov
Greenhorn

Joined: Mar 28, 2006
Posts: 5
Thanks Kristian.
I got it now. Looks like this is a flaw in the new for each loop which makes it pointless to some extend, because initializing arrays would be one of its main purposes.
Djoga
J Sato
Ranch Hand

Joined: Mar 30, 2006
Posts: 40
Didn't see this one here...

p541 paragraph 1 - typo "king of order" should be "kind of order"
Lavanya Raguram
Greenhorn

Joined: Apr 03, 2006
Posts: 27
259 &
266 suggest To avoid confusion with the 'wrapper pool':
Q-2, Short story = 5; s/b Short story = 200;


now wat will be the difference n can a short wrapper be able to store more than 127?
Higgledy Smith
Ranch Hand

Joined: Mar 07, 2006
Posts: 192
I am not trying to be dense. But what does this mean in Bert's post to this thread:

bump


Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8815
    
    5
Hey Lavanya - let's keep this thread just for the errata - there is another thread that's busy discussing this topic thanks

Higgledy - bump just means if you add a post to an old thread it "bumps" it back to the front page
Oscar Gonzalez
Ranch Hand

Joined: Mar 28, 2006
Posts: 63
In the top of the page 319 there is a sentence that says:

"Once an else if succeds, none of the remaining else ifs or elses will be tested"

The word elses suggest that you can have zero or more "else" clauses which is not true.
vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
OMG.... I should have seen this thread before buying it yesterday!!

Hi Bert! So where can we check the finalized errata?


I'm not available, my BF's name is WORK.
Kristian Perkins
Ranch Hand

Joined: Mar 27, 2006
Posts: 32
Here ara a few more:

page 234: replace both occurrences of

with

page 381:
the swich code sample, the case statements for 1, 2 and 3 need break statements to prevent fall through to the "We're never supposed to get here!" default case. Also in the paragraph below replace 'x must be either 2, 3 or 4' with 'x must be either 1, 2 or 3'.

page 631: Q 13 Answer, last sentance replace 'methods are not defined in the List interface.' with 'methods are not defined in the Arrays or Collections classes.'
[ April 10, 2006: Message edited by: Kristian Perkins ]
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8815
    
    5
I sent an email off to the publisher late last week to get started on the official errata page - we'll let you know when it's available.
gaurav singhal
Ranch Hand

Joined: Nov 18, 2005
Posts: 135
Bert pg 94 i feel that this example is wrong

public class Horse extends Animal {
private Halter myHalter;//it should be private Halter myHalter = new Halter();
public void tie(LeadRope rope) {
myHalter.tie(rope); // Delegate tie behavior to the
// Halter object
}
}
public class Halter {
public void tie(LeadRope aRope) {
// Do the actual tie work here
}
}


plz confirm
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
p581 Exam Watch at bottom of page:
...even if that Object reference points (yuck) to an Integer(or some other primitive) on the heap.

Primitive? On the heap? It should be Wrapper object, surely?
[ April 11, 2006: Message edited by: Barry Gaunt ]
Eddie Fu
Greenhorn

Joined: Apr 02, 2006
Posts: 4
On page 682, under exam watch:

Runnable r = new Runnable();
...

I don't think it is legal since you cannot instantiate an interface.
Kristian Perkins
Ranch Hand

Joined: Mar 27, 2006
Posts: 32
Eddie,

No it is not legal and is mentioned in the updated errata
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8815
    
    5
This thread is locked.

The updated K & B errata list is here:

http://www.coderanch.com/t/253802/java-programmer-SCJP/certification/Updated-Errata
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JavaRanch Exclusive! temporary K&B 5 errata