• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mike Hallet
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Sheriff
Posts: 8898
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Bert
 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice first post! Welcome to Javaranch Mike.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic