• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice first post! Welcome to Javaranch Mike.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic