Programming Books C Java PHP Python Learn more Browse Programming Books
JavaTM Puzzlers: Traps, Pitfalls, and Corner Cases and over one million other books are available for Amazon Kindle. Learn more
Qty:1
  • List Price: $49.99
  • Save: $10.00 (20%)
Only 9 left in stock (more on the way).
Ships from and sold by Amazon.com.
Gift-wrap available.
Java Puzzlers: Traps, Pit... has been added to your Cart
FREE Shipping on orders over $35.
Used: Good | Details
Sold by chris6ooks
Condition: Used: Good
Comment: Some wear on the covers. No CD (if any?) Book inside is in good and clean condition.
Access codes and supplements are not guaranteed with used items.
Trade in your item
Get a $4.30
Gift Card.
Have one to sell? Sell on Amazon
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image

Java Puzzlers: Traps, Pitfalls, and Corner Cases Paperback – July 4, 2005

ISBN-13: 978-0321336781 ISBN-10: 032133678X

Buy New
Price: $39.99
31 New from $25.00 23 Used from $22.00
Amazon Price New from Used from
Kindle
"Please retry"
Paperback
"Please retry"
$39.99
$25.00 $22.00
Amazon%20Web%20Services

$39.99 FREE Shipping. Only 9 left in stock (more on the way). Ships from and sold by Amazon.com. Gift-wrap available.

Frequently Bought Together

Java Puzzlers: Traps, Pitfalls, and Corner Cases + Effective Java (2nd Edition) + Java Concurrency in Practice
Price for all three: $115.65

Buy the selected items together

NO_CONTENT_IN_FEATURE

Shop the New Digital Design Bookstore
Check out the Digital Design Bookstore, a new hub for photographers, art directors, illustrators, web developers, and other creative individuals to find highly rated and highly relevant career resources. Shop books on web development and graphic design, or check out blog posts by authors and thought-leaders in the design industry. Shop now

Product Details

  • Paperback: 312 pages
  • Publisher: Addison-Wesley Professional (July 4, 2005)
  • Language: English
  • ISBN-10: 032133678X
  • ISBN-13: 978-0321336781
  • Product Dimensions: 9.2 x 7.4 x 0.7 inches
  • Shipping Weight: 1.4 pounds (View shipping rates and policies)
  • Average Customer Review: 4.4 out of 5 stars  See all reviews (39 customer reviews)
  • Amazon Best Sellers Rank: #335,860 in Books (See Top 100 in Books)

Editorial Reviews

From the Back Cover

"Every programming language has its quirks. This lively book reveals oddities of the Java programming language through entertaining and thought-provoking programming puzzles."

--Guy Steele, Sun Fellow and coauthor ofThe Java(tm) Language Specification

"I laughed, I cried, I threw up (my hands in admiration)."

--Tim Peierls, president, Prior Artisans LLC, and member of the JSR 166 Expert Group

How well do you really know Java? Are you a code sleuth? Have you ever spent days chasing a bug caused by a trap or pitfall in Java or its libraries? Do you like brainteasers? Then this is the book for you!

In the tradition ofEffective Java(tm), Bloch and Gafter dive deep into the subtleties of the Java programming language and its core libraries. Illustrated with visually stunning optical illusions,Java(tm) Puzzlersfeatures 95 diabolical puzzles that educate and entertain. Anyone with a working knowledge of Java will understand the puzzles, but even the most seasoned veteran will find them challenging.

Most of the puzzles take the form of a short program whose behavior isn't what it seems. Can you figure out what it does? Puzzles are grouped loosely according to the features they use, and detailed solutions follow each puzzle. The solutions go well beyond a simple explanation of the program's behavior--they show you how to avoid the underlying traps and pitfalls for good. A handy catalog of traps and pitfalls at the back of the book provides a concise taxonomy for future reference.

Solve these puzzles and you'll never again fall prey to the counterintuitive or obscure behaviors that can fool even the most experienced programmers.



About the Author

Joshua Bloch is a principal engineer at Google and a Jolt Award-winner. He was previously a distinguished engineer at Sun Microsystems and a senior systems designer at Transarc. Josh led the design and implementation of numerous Java platform features, including JDK 5.0 language enhancements and the award-winning Java Collections Framework. He holds a Ph.D. in computer science from Carnegie Mellon University.

Neal Gafter is a software engineer and Java evangelist at Google. He was previously a senior staff engineer at Sun Microsystems, where he led the development of the Java compiler and implemented the Java language features in releases 1.4 through 5.0. Neal was a member of the C++ Standards Committee and led the development of C and C++ compilers at Sun Microsystems, Microtec Research, and Texas Instruments. He holds a Ph.D. in computer science from the University of Rochester.




More About the Author

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

And besides, it was very very entertaining reading.
vrto
I strongly recommend that all Java programmers read this book.
Charles Ashbacher
It is a kind of book that you simply can't stop reading.
Constantine Kulak

Most Helpful Customer Reviews

100 of 103 people found the following review helpful By Bob Carpenter on November 22, 2005
Format: Paperback Verified Purchase
My wife popped this book open after dinner. Big mistake -- we had planned to spend the night watching Firefly on DVD. She read the first puzzle. We went to the blackboard (yes, we're so geeky and our NY apartment's so small that there's a blackboard in the dining nook). Between us, we had half a dozen possible answers about what a three-line program was going to do. We found at least four boundary conditions and were pretty sure about two of them. For the record, the first puzzle she opened to involved the compound XOR assignment statement x^=y^=x^=y. They're not all that bit-fiddly; some of the other puzzles include class and method mazes, integer or double arithmetic oddities, unexpected exception/initialization interactions, string/charset twistiness, etc.

I thought I'd be good at this kind of puzzle. As an academic, I wrote about programming languages. I read Bloch's "Effective Java" book. Twice. I follow its advice religously and make my coworkers read it. I've read most of the source code for String, StringBuffer and the collections framework and I/O streams. I just came off a week-long coding project where I did exclusively bit-level I/O with all the shifts and masks you could ask for. I was wrong. I got about 1/5 of the puzzles right if I give myself partial credit for diagnosing the boundary condition in the question and having the right answer be in my top two or three guesses.

Unless you've written the bit fiddling parts of a JVM implementation, or are the kind of person who can remember minute details of the specification, you'll most likely suffer. And love it. Then you can relate the puzzles at gatherings of geeks and look on with a smug grin as they twist in the wind. These would be perfect interview questions for a sadistic HR person.
Read more ›
1 Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
Format: Paperback
This book is filled with brainteasers about the Java programming language and its core libraries. Anyone with a working knowledge of Java can understand these puzzles, but many of them are tough enough to challenge even the most experienced programmer. Puzzlers are grouped according to the features they use, but you cannot assume that the trick to a puzzle is related to its chapter heading.

Most of the puzzles exploit counterintuitive or obscure behaviors that can lead to bugs. Every platform has them, but Java has far fewer than other platforms of comparable power. The goal of the book is to entertain the reader with puzzles while teaching you to avoid the underlying traps and pitfalls. By working through the puzzles, you become less likely to fall prey to these dangers in your own code and more likely to spot them the code of others over which you have maintenance priveleges.

This book is meant to be read while you have access to a computer that has a Java development environment installed, ideally JDK 5.0, which is the latest release at the time I am writing this. That is because some of the puzzles rely on pitfalls in this particular release of Java.

Most of the puzzles take the form of a short program that appears to do one thing but actually does something else. It's the reader's job to figure out what each program does. It would be best if you first study the program/puzzle and determine what you think it will do. Next, run the program and see if its expected behavior matches its actual behavior. Try to fix the program if you believe it is "broken". Finally, read the solution and see if it matches your answer. What is really great about this book is that it sticks to pitfalls in the core language and doesn't delve into any of the add-on API's or J2EE.
Read more ›
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
18 of 18 people found the following review helpful By Kevin J. Schmidt on July 15, 2005
Format: Paperback
Many C and C++ books exist that discuss traps and pit falls with each language. Now Java has such a book. This book is fun to read and will challenge even the best Java programmers. Be sure to get the source code from [...] Study each puzzle and try figure out what it does or does not do. Then run the example code and see if you were right. If you weren't right, then try to figure out why you guessed wrong and figure out how to fix the program. Then turn the page and read the solution.

Working through the puzzlers is not only fun, but it will definitely make you a much better Java programmer and a better troubleshooter.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
13 of 13 people found the following review helpful By Cliff L. Biffle on July 14, 2005
Format: Paperback
I've been passing this book around my office, describing it alternately as "C Traps and Pitfalls on steroids" or "The most fun that can be had with the Java Language Specification with your clothes on." Thus far, it has not failed to frustrate, educate, enlighten, and amuse each reader, usually in that order. I can't think of any better way to become more familiar with the ins, outs, and warts of the Java language: the puzzles, memorable and clever as they are, stick with you.

The writing is fluid, friendly, and full of wit, from the names of the puzzles (like "The Lock Mess Monster" or "Dyslexic Monotheism") to the commentary on the finer points. Even the layout shows thought, with the answers out of plain sight behind the next page.

If your brain burns out on the puzzles, check out the optical illusions in between. (Note: do not, during a car ride, show them to anyone who is prone to motion sickness. I learned this the hard way, so you don't have to.)

I strongly recommend this book if you spend any time in or around Java code. I've had to deal with many of the pitfalls it highlights, and boy, would it have been more pleasant if I'd already read this book.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Most Recent Customer Reviews


What Other Items Do Customers Buy After Viewing This Item?