Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Which Java book do you think is the must-have one for all Java developers?

Keep in mind:

  • One book per answer
  • Check for duplicates before adding new answers
share

migration rejected from stackoverflow.com Mar 23 at 19:30

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as not constructive by Walter, Mark Trapp Jul 10 '11 at 17:37

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

show 1 more comment

16 Answers

up vote 339 down vote accepted

Effective Java, Second Edition by Joshua Bloch. No question.

If every Java developer read this book, there would be a lot less broken code in the world.

After that, I'd read Java Concurrency in Practice (see separate answer), and maybe Java Generics and Collections (see separate answer). Anyone that reads and puts into practice the information in these three books has come a long way toward mastering Java.


Comments from duplicate "Effective Java" answers:

"I sure wish I had 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.

sammyo: It's a thin(!!) volume that focuses on real issues and how to think about the right approach to java problems. (as opposed to a listing of API methods)

Hans Doggen: First edition of Effective Java and then the second edition, to see some of the ideas that changed over time.

share
15  
Choosing an "answer" for this question is unfair. Each person answering posts their own opinion and the community votes the more relevant answers up. If a book better than EJ2 is released, this page might turn out to be useless, because one opinion is already anointed as the "answer". –  binil Sep 16 '08 at 19:26
6  
"If every Java developer read this book ..." what you wanna say is "If every Java developer read and understood this book ..." –  Chris Sep 25 '09 at 17:03
5  
+1000 for Effective Java, I have been reading this every day during my lunch break, and it's hands-down one of the best programming books I've ever read. –  BlueRaja - Danny Pflughoeft May 18 '10 at 15:25
3  
@binil I don't see how any Java book could ever become more important than Effective Java 2nd ed. except for maybe... Effective Java 3rd ed. –  jluzwick Feb 16 '11 at 18:06
show 2 more comments

Thinking in Java by Bruce Eckel


Comments from duplicate answers:

prash: Thinking in Java by Bruce Eckel is a great book for beginners and teaches you not only the "What"s and "How"s of Java but also the "Why"s. It is available from the above link.

Michael Easter: It is an introduction and yet discusses the background behind Generics, Swing, elementary threading, and a large metaphor for Java NIO. It is a massive work that covers the range from beginner to expert. There are other books that are better for experts but would be wasted on novices.

share
show 3 more comments

When it comes to multithreading, Java Concurrency in Practice is the choice.

share
3  
Brilliant brilliant book. I guess I'm considered something of a concurrency expert at my employer, yet every time I look in this book I go "wow, I didn't realise it worked like that". –  Cowan Oct 1 '10 at 4:19
add comment

Head First Design Patterns - not necessarily a pure Java book, but essential for every Java developers who designs his applications himself.

share
2  
-1 on this one, sorry. Design patterns are better discovered than learned. –  BlueRaja - Danny Pflughoeft May 18 '10 at 15:28
4  
@Jonik, yes - even those that learned patterns from the GoF book as this book teaches you how Design patterns are evolved and principles behind a pattern. It teaches you how to discover patterns instead of learning it. @BlueRaja... I agree and that's exactly the reason why I recommend this book. Too bad you haven't read it bevor voting down ;-) –  Yaba May 26 '10 at 21:03
show 2 more comments

Java Puzzlers is another great one by Joshua Bloch (with Neal Gafter).

http://www.javapuzzlers.com/lg-puzzlers-cropped.jpg

The entire content of the book is just small Java applications that are quirky enough that they don't necessarily behave how you might immediately think.

share
1  
by J Bloch and N Gafter –  Michael Easter Oct 3 '08 at 21:01
show 1 more comment

Head First Java is great for beginners.

Effective Java will take you from journeyman to master.

share
add comment

Refactoring by Martin Fowler

Especially the chapter about Bad Smells in Code should be understood by everyone.

share
add comment

Java Programming Language is a good way to learn Java. I would highly recommend it.

share
3  
This is the second best book after Effective Java (but one should read this at first). I don't understand why it got only one vote before my vote. This is the only book that could explain to me Java Generics. I wish I had discovered earlier. –  zilupe Jun 2 '09 at 12:52
add comment

Core Java Vol 1 and Vol 2 by Cay S. Horstmann.

Hard to read but very informative and without excess words. These books cover every aspect in Java SE. But this book will be a little hard for beginners IMO.

share
show 1 more comment

O'Reilly's Java in a Nutshell is a good book for both tutorials and reference.

share
1  
This book only covers up to Java 5 so it might be a bit outdated as a reference. –  Li Lo Sep 3 '09 at 21:38
show 1 more comment

Java Language Specification (also freely available online) is great if you want to get deeper into the semantics of Java language.

(Links and comments above merged from a duplicate answer by folone.)

share
show 1 more comment

Java Generics and Collections by Maurice Naftalin & Philip Wadler. Philip Wadler is one of Java generics grandfather. Java is close enough to C++ that it wasn't a big deal at all for me to switch over, that was until I started using Generics. This book is a gold mine of info.

share
show 1 more comment

Better, Faster, Lighter Java by Bruce A. Tate and Justin Gehtland

It's a really good one.

share
4  
It's good, but a little dated, I find. For example, the whole anti-EJB diatribe is a bit boring to read in 2008, since that debate was settled so long ago, now. To me, The Pragmatic Programmer's way of presenting principles and techniques is more timeless. –  Mwanji Ezana Sep 16 '08 at 18:59
1  
+-0 I agree with Mwanji. The promise of the book (from the back cover or Amazon summary) seemed great. But for me, it didn't really deliver: nothing that new; examples not especially well thought out; not written in a very engaging manner (when compared to the best Java books I've read). –  Jonik Apr 14 '09 at 16:13
add comment

Filthy Rich Clients, by Chet Haase and Romain Guy. Those guys are Swing ninjas.

share
add comment

If you want to understand, how it all works, The Java Virtual Machine Specification (also freely available online) is the book for you.

share
add comment