Effective Java, Second Edition by Joshua Bloch is an updated version of the classic first edition, which was the winner of a 2001 Jolt Award. This edition has been updated to discuss Java 6 language features, and the back cover of the book describes some of the new topics covered as:
- 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
The book's publisher, Addison-Wesley, made an excerpt available to InfoQ which includes the contents of the fifth chapter, entitled 'Generics'.
Read Book Excerpt and Interview: Effective Java, Second Edition
From the article:
InfoQ: Are there major changes between the previous version of 'Effective Java' and this one, or is it more of a refinement of existing ideas?
Joshua Bloch: It's a combination of additions and refinements. The second edition covers all the new language features. It has a chapter on generics, one on enums and annotations, and items on the for-each loop, autoboxing, varargs, and static import. The concurrency chapter has been thoroughly revised in light of java.util.concurrent. And all the existing items have been revised to reflect these new features, and to reflect seven more years of experience with the platform.
That said, I worked very hard not to alter the feel of the book. Hopefully it will feel like an old friend to readers of the first edition -- a little wiser and little heavier (21 items and 83 pages, to be precise), but an old friend.
Community comments
Great news
by prashant jalasutram,
what comment ?
by anjan bacchu,
Re: what comment ?
by Ryan Slobojan,
Probable small error on sample chapter
by Rafael de F. Ferreira,
Re: Probable small error on sample chapter
by Rai Singh,
Re: Probable small error on sample chapter
by Joshua Bloch,
Re: Probable small error on sample chapter
by Mark Shaffer,
Good Book
by prathap gym,
Great news
by prashant jalasutram,
Your message is awaiting moderation. Thank you for participating in the discussion.
Josh,
We all love you and you are the star!!!!!
Thanks
Prashant
what comment ?
by anjan bacchu,
Your message is awaiting moderation. Thank you for participating in the discussion.
"They also asked us to add the following comment:"
which comment were you referring to ?
BR,
~A
Re: what comment ?
by Ryan Slobojan,
Your message is awaiting moderation. Thank you for participating in the discussion.
My apologies - the comment being referred to is now found at the bottom of the article. When it was moved, the line you mentioned was not updated - it has been fixed now.
Thanks for catching that!
Probable small error on sample chapter
by Rafael de F. Ferreira,
Your message is awaiting moderation. Thank you for participating in the discussion.
I'm very excited about this edition, and it is great to see InfoQ offering the generics chapter so we can take a peek before the book begins to ship. I don't know if this is the version that went to press, but I think there is a small error on a code snippet. On the bottom of page 121 we find:
But I believe the inner loop should have been:
Re: Probable small error on sample chapter
by Rai Singh,
Your message is awaiting moderation. Thank you for participating in the discussion.
I am not sure I agree with your change entirely since the index of the array is never referenced in your code from within the for-each loop. However, I can see what you mean by the book version being incorrect since snapshot is not used anywhere.
Re: Probable small error on sample chapter
by Joshua Bloch,
Your message is awaiting moderation. Thank you for participating in the discussion.
Rafael,
You are absolutely right. What's worse, I caught this problem before the book went to print. I fixed it in the code example bundle (which will soon be posted on the book's web site). Somehow I failed to propagate the change into the book. I hope this is the only place where I did this.
I will fix the problem in the second printing and put it on the (currently nonexistent) errata page as soon as possible.
Thanks for spotting this!
Josh
Re: Probable small error on sample chapter
by Mark Shaffer,
Your message is awaiting moderation. Thank you for participating in the discussion.
Good Book
by prathap gym,
Your message is awaiting moderation. Thank you for participating in the discussion.
Very interesting & useful book. I really liked it
Java Training in Chennai