It's not a secret anymore!
The moose likes Bunkhouse Porch and the fly likes Errata for Java 2 Study Guide? (K&B) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Books » Bunkhouse Porch
Bookmark "Errata for Java 2 Study Guide? (K&B)" Watch "Errata for Java 2 Study Guide? (K&B)" New topic

Errata for Java 2 Study Guide? (K&B)

Mike Hallet

Joined: Mar 28, 2006
Posts: 1
I didn't see this mentioned in the offical errata document, nor could I find mention of it on the forums.

Sun Certified Programmer and Developer for Java 2 Study Guide (Exam 310-035 and 310-037)

Top of Page 265

switch (x) {
case 2: y = 3;
case 3: y = 17;
case 4: y = 27;
default: assert false; // We're never supposed to get here!

The problem is, you will always get there because a lack of break statements will always cause us to fall-through to the default statement.
Bert Bates

Joined: Oct 14, 2002
Posts: 8898
Pretty amazing Mike!

That error has been sitting there for 3 1/2 years and no one spotted it, we even copied it over to the new 1.5 edition of the book.

Great catch!

So, you're 1 for 1 - I hope your accuracy rate goes down


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

Joined: Jan 19, 2001
Posts: 4012
Nice first post! Welcome to Javaranch Mike.
I agree. Here's the link:
subject: Errata for Java 2 Study Guide? (K&B)
It's not a secret anymore!