Effective Java (2nd Edition) (Java Series) and over one million other books are available for Amazon Kindle. Learn more



or
Sign in to turn on 1-Click ordering
Sell Us Your Item
For a $23.74 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Start reading Effective Java (2nd Edition) (Java Series) on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Sorry, this item is not available in
Image not available for
Color:
Image not available

To view this video download Flash Player

 

Effective Java (2nd Edition) [Paperback]

Joshua Bloch
4.8 out of 5 stars  See all reviews (112 customer reviews)

Buy New
$39.57 & FREE Shipping. Details
Rent
$26.00 & this item ships for FREE with Super Saver Shipping. Details
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.
In Stock.
Want it tomorrow, May 22? Choose One-Day Shipping at checkout. Details
Free Two-Day Shipping for College Students with Amazon Student

Formats

Amazon Price New from Used from
Kindle Edition $25.07  
Paperback $39.57  
Unknown Binding --  
Sell Back Your Copy for $23.74
No matter where you bought them, get up to 70% back when you sell your books at Amazon.com.
Used Price$29.95
Trade-in Price$23.74
Price after
Trade-in
$6.21

Book Description

May 28, 2008 0321356683 978-0321356680 2

Are you looking for a deeper understanding of the Java™ programming language so that you can write code that is clearer, more correct, more robust, and more reusable? Look no further! Effective Java™, Second Edition, brings together seventy-eight indispensable programmer’s rules of thumb: working, best-practice solutions for the programming challenges you encounter every day.

 

This highly anticipated new edition of the classic, Jolt Award-winning work has been thoroughly updated to cover Java SE 5 and Java SE 6 features introduced since the first edition. Bloch explores new design patterns and language idioms, showing you how to make the most of features ranging from generics to enums, annotations to autoboxing.

 

Each chapter in the book consists of several “items” presented in the form of a short, standalone essay that provides specific advice, insight into Java platform subtleties, and outstanding code examples. The comprehensive descriptions and explanations for each item illuminate what to do, what not to do, and why.

 

Highlights include:

  • New coverage of generics, enums, annotations, autoboxing, the for-each loop, varargs, concurrency utilities, and much more
  • Updated techniques and best practices on classic topics, including objects, classes, libraries, methods, and serialization
  • How to avoid the traps and pitfalls of commonly misunderstood subtleties of the language
  • Focus on the language and its most fundamental libraries: java.lang, java.util, and, to a lesser extent, java.util.concurrent and java.io

Simply put, Effective Java™, Second Edition, presents the most practical, authoritative guidelines available for writing efficient, well-designed programs.


Best Value

Buy Effective Java (2nd Edition) and get The Java EE 6 Tutorial: Advanced Topics (4th Edition) (Java Series) at an additional 5% off Amazon.com's everyday low price.

Effective Java (2nd Edition) + The Java EE 6 Tutorial: Advanced Topics (4th Edition) (Java Series)
Buy together today: $66.32

Show availability and shipping details



Editorial Reviews

Review

Raves for the First Edition!

 

“I sure wish I had this book ten years ago. Some might think that I don’t need any Java books, but I need this one.”

—James Gosling, fellow and vice president, Sun Microsystems, Inc.

 

“An excellent book, crammed with good advice on using the Java programming language and object-oriented programming in general.”

—Gilad Bracha, coauthor of The Java™ Language Specification, Third Edition

 

“10/10—anyone aspiring to write good Java code that others will appreciate reading and maintaining should be required to own a copy of this book. This is one of those rare books where the information won’t become obsolete with subsequent releases of the JDK library.”
—Peter Tran, bartender, JavaRanch.com

 

“The best Java book yet written.... Really great; very readable and eminently useful. I can’t say enough good things about this book. At JavaOne 2001, James Gosling said, ‘Go buy this book!’ I’m glad I did, and I couldn’t agree more.”
—Keith Edwards, senior member of research staff, Computer Science Lab at the Palo Alto Research Center (PARC), and author of Core JINI (Prentice Hall, 2000)

 

“This is a truly excellent book done by the guy who designed several of the better recent Java platform APIs (including the Collections API).”
—James Clark, technical lead of the XML Working Group during the creation of the XML 1.0 Recommendation, editor of the XPath and XSLT Recommendations

 

“Great content. Analogous to Scott Meyers’ classic Effective C++. If you know the basics of Java, this has to be your next book.”
—Gary K. Evans, OO mentor and consultant, Evanetics, Inc

 

“Josh Bloch gives great insight into best practices that really can only be discovered after years of study and experience.”
—Mark Mascolino, software engineer

 

“This is a superb book. It clearly covers many of the language/platform subtleties and trickery you need to learn to become a real Java master.”
—Victor Wiewiorowski, vice president development and code quality manager, ValueCommerce Co., Tokyo, Japan

 

“I like books that under-promise in their titles and over-deliver in their contents. This book has 57 items of programming advice that are well chosen. Each item reveals a clear, deep grasp of the language. Each one illustrates in simple, practical terms the limits of programming on intuition alone, or taking the most direct path to a solution without fully understanding what the language offers.”

—Michael Ernest, Inkling Research, Inc.

 

“I don’t find many programming books that make me want to read every page—this is one of them.”
—Matt Tucker, chief technical officer, Jive Software

 

“Great how-to resource for the experienced developer.”
—John Zukowski, author of numerous Java technology books

 

“I picked this book up two weeks ago and can safely say I learned more about the Java language in three days of reading than I did in three months of study! An excellent book and a welcome addition to my Java library.”
—Jane Griscti, I/T advisory specialist

About the Author

Joshua Bloch is chief Java architect at Google and a Jolt Award winner. He was previously a distinguished engineer at Sun Microsystems and a senior systems designer at Transarc. Bloch led the design and implementation of numerous Java platform features, including JDK 5.0 language enhancements and the award-winning Java Collections Framework. He coauthored Java™ Puzzlers (Addison-Wesley, 2005) and Java™ Concurrency in Practice (Addison-Wesley, 2006).


Product Details

  • Paperback: 346 pages
  • Publisher: Addison-Wesley; 2 edition (May 28, 2008)
  • Language: English
  • ISBN-10: 0321356683
  • ISBN-13: 978-0321356680
  • Product Dimensions: 7.3 x 1 x 9.2 inches
  • Shipping Weight: 1.6 pounds (View shipping rates and policies)
  • Average Customer Review: 4.8 out of 5 stars  See all reviews (112 customer reviews)
  • Amazon Best Sellers Rank: #2,114 in Books (See Top 100 in Books)

More About the Author

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

Customer Reviews

Every Java programmer must read this book! VJ  |  43 reviewers made a similar statement
The writing style is clear and easy to understand. Chandra Srinivasan  |  22 reviewers made a similar statement
Most Helpful Customer Reviews
73 of 75 people found the following review helpful
5.0 out of 5 stars A powerful update to an already-classic title May 16, 2008
Format:Paperback
Please see my review of the first edition for my general response. My opinion hasn't changed with the second, so I'll focus on what's new in this review.

The second edition was well worth the wait. The number of items are beefed up to 78 from 57. The chapter "Substitutes for C Constructs" is gone, but replaced by more contemporary material on "Generics" and "Enums and Annotations." Some first edition items have been amended to address features new to Java since the first edition was released. Some new items also address concurrency, favoring it over traditional Java threads. As expected, the cases for each item are methodically and persuaisvely made. If you are particularly interested in concurrency, also consider Java Concurrency in Practice.

The item discussions use boldface liberally to highlight key points, sometimes calling attention to arguments in the first edition that have been updated. If you're skimming -- the author in fact doesn't encourage cover-to-cover reading -- these highlights are useful attractors to important material you might otherwise gloss.

It's often helpful to have practices or insights you've earned on your own backed up by a reputable authority. Effective Java certainly helps with that. More importantly, the arguments that support his items are clear, easy to read, and compelling. Anyone proficient with Java would have to go a long way to find fault with them. In fact, it took considerable investigation to determine that one item from the first edition -- "Provide a readResolve method when necessary" -- was not the best advice for some cases. Bloch addresses that issue head-on in this edition, and provides its replacement ("For instance control, prefer enum types to readResolve").

As with the first edition, this one is a necessity for any serious Java developer.
Was this review helpful to you?
50 of 52 people found the following review helpful
5.0 out of 5 stars Simply a great book! June 30, 2008
Format:Paperback
Effective Java, Second Edition by Joshua Bloch is certainly the best Java book I have read in a long time. As a disclaimer, I never read the first edition and I am thus unable to compare the two editions. Effective Java, Second Edition is a mostly easy and fun read providing you with many insights and best practices on how to use Java effectively. It certainly is not a book for the beginner just starting out learning Java. For that purpose you may want to take a look at Thinking in Java by Bruce Eckel instead. Nevertheless, Effective Java would serve as an excellent follow-up.

In Effective Java, Joshua Bloch does a great job describing best practices that you as developer will find useful on a daily basis. For example, I really found his description of the builder pattern (Item 2, page 11) quite interesting. Another Item that fascinated me, was Item 15 (page 73) - "Minimize mutability". Both items are part of a broader theme throughout the book that promotes creating code that is as immutable as possible. In that regard, reading the book will enable you to simply write better and safer code. The book also leads the way towards promoting functional programming techniques which will come in quite handily when developing multithreaded applications. Therefore, as a next book I may recommend reading Java Concurrency in Practice by Brian Goetz.

Even for the experienced Java developer, Effective Java contains quite a few little eye openers. I for example was previously unaware of how static factory methods can simplify the creation of parameterized type instances using "type inference". This is described on page 9 (Item 1). In the past I had always used something like this:

List<User> users = new ArrayList<User>();

But by using a static factory method you can do:

List<User> users = Helper.newArrayList();

I thought that this was a pretty nifty example that may help making code a bit cleaner. What I also very much liked about Effective Java was that Joshua points out certain short-comings of the Java language itself and its APIs whenever applicable. For example, page 64 describes the inconsistent behavior between BigDecimal's 'equals' method and its 'compareTo' method, and in item 41 (page 194) Joshua details the shortcomings of the List interface when using Autoboxing.

While the vast majority of the book was very easy to read and to understand, I found that the chapter about bounded wildcards using generics (item 28) was a little difficult to grasp and I wished it were a bit more extensive. On the other side, the provided mnemonic is quite helpful: PECS - Producer-extends, Consumer-super.

Overall, I highly recommend Effective Java, Second Edition which will continue to serve me, and likely you too, as an excellent reference resource.
Comment | 
Was this review helpful to you?
70 of 76 people found the following review helpful
4.0 out of 5 stars Good, but not all items are equal May 12, 2010
Format:Paperback
If you want to know the good things about this book, read the other reviews, many of which I agree with. This review just states what makes the book 4 stars for me instead of 5, because none of the other reviews I read pointed them out.

Most of the items in book are very good, a few are great and well worth the price of the book and the time it takes to read it, but some have to be taken with a grain of salt. They probably make sense if you come from the background of working on the Java API team, as the author does, but wouldn't make much sense on any of the projects I have worked on. The problem is that all are presented as universal truths and only through experience can you tell which truly are and which can be ignored.

I also feel that some of the items need to be tempered with just plain practical usefulness. I know that programming a certain way makes the code bullet proof from certain errors by not compiling if those errors are introduced, but if the code is quite a bit harder to understand and those errors are rare, is it really worth it? Also, some of the items are written as if everything you are writing is being published and supported publicly. If code and interfaces are just being used between two teams within the company, or even just on a single team, some of the logic used to describe why items are important don't make as much sense. Again, I just feel that these are something that make complete sense if you are writing on the API team, but not necessarily in every other case.

My final small complaint is that the author tends to be a bit wordy on some of the items, fully explaining out every nuance of the wrong way to do it, which tends to create noise in some explanations that are pretty heavy anyway.

Overall, I would recommend the book, it has already made my programming better. An additional note is that I did not find any errors in the code examples or even the formatting, something that I find rare in programming books.
Was this review helpful to you?
Most Recent Customer Reviews
2.0 out of 5 stars Difficult to follow
I am not a complete beginner to programming, but I found many of the examples really difficult to follow what was trying to be taught; however, much of the book does make valid... Read more
Published 1 day ago by j
5.0 out of 5 stars Must read book for every Java programmer
Book is stuffed with Java best practices. Recommends what to do, how to effectively program in Java. I can recommend this book to every Java programmer.
Published 8 days ago by Boris Belovic
5.0 out of 5 stars Invaluable Reference
I bought this book some time ago. I love its brevity of words, to-the-point advice and code examples. Read more
Published 1 month ago by D. Kieran Kelleher
5.0 out of 5 stars Insightful Book Filled with Invaluable Information for any Java...
Absolutely the best book on Java I have ever come across. Everything I hoped for from one of Java's creators. Read more
Published 1 month ago by Jeffrey M. Kuhlman
5.0 out of 5 stars Possibly the best Java book I have ever read!
This is one of those books that makes you think differently about programming in general. It is about good programming practices using the Java Programming Language. Read more
Published 1 month ago by Jack Matthews
5.0 out of 5 stars Very deep, very heavy on the mind and very good
I'll start this review telling you what this book is not:
- This is not a cookbook. You will not find template solutions to regular programming problems here. Read more
Published 1 month ago by Kadun
5.0 out of 5 stars Excellent!
A great book indeed. A "must read" for anyone interested in serious programming with Java. Bloch has a way with words that developers rarely possess. Read more
Published 2 months ago by Juntar
2.0 out of 5 stars Useless
if one doesn't program in Java anymore. Because for my work it's become too complex, too difficult to navigate amongst components, and not very useful in the scientific models I... Read more
Published 2 months ago by WR Funk
5.0 out of 5 stars Exactly what I was looking for
Like it is said, this book is not for learning java from scratch, but for learning how to use it effectively. If you want to know Java, buy this book!
Published 2 months ago by Maria
3.0 out of 5 stars a good book but out-dated
This is a very good book teaching how to program Java effectively. It is a little bit out-dated as it refers to Java 1.5 very frequently, but we are in Java 7 now. Read more
Published 2 months ago by M.O. Yang
Search Customer Reviews
Only search this product's reviews

What Other Items Do Customers Buy After Viewing This Item?


Customer Questions & Answers
Please make sure that your post is a question about the product. Edit your question or post anyway.



So You'd Like to...


Create a guide


Look for Similar Items by Category