Home > Store > Programming > Java
Effective Java™ Programming Language Guide
- By Joshua Bloch
- Published Jun 5, 2001 by Addison-Wesley Professional. Part of the Java Series series.
- Copyright 2001
- Dimensions: 7-3/8x9-1/4
- Pages: 272
- Edition: 1st
- Book
- ISBN-10: 0-201-31005-8
- ISBN-13: 978-0-201-31005-4
Register your product to gain access to bonus material or receive a coupon.
PTR Overview
Effective Java Programming Language Guide distills the hard-won wisdom of today's best Java programmers into 50 techniques for designing and constructing more robust, high-performance software. Josh Bloch, one of Sun's most widely respected Java developers, focuses on the practical problems virtually every Java developer encounters, offering specific solutions and top-notch code examples.KEY TOPICS:Josh Bloch identifies 50 practices that lead directly to better code -- including better alternatives for common practices that have proven undesirable in real-world development. The techniques are specific, thoroughly explained, and supported by top-notch code examples. Among the highlights: why developers should avoid finalizers; when to use delegation instead of inheritance; and how to make the most of Java's powerful typesafe enum pattern. Nearly all 50 practices relate to the "core" of the Java platform -- the language itself -- making the book relevant to virtually every Java developer.MARKET:For all experienced Java programmers, and for C++ programmers who want to maximize their Java expertise and productivity as quickly as possible.
PTR Bullets
50 powerful techniques for improving every Java program and design!
- The book that does for Java what Scott Meyers' Effective C++ does for C++.
- Top-notch code examples and real-world Java development "war stories."
- This is the "most asked for" book!
Product Author Bios
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.
A new edition of this title is available, ISBN-10: 0321356683 ISBN-13: 9780321356680
Related Articles
|
194 of 197 people found the following review helpful
By
Amazon Verified Purchase(What's this?)
This review is from: Effective Java: Programming Language Guide (Java Series) (Paperback)
This book contains a generous cross-section of the knowledge that differentiates Java gurus from advanced Java programmers.I've been working full-time in Java since 1995, prior to version 1.0. I've also written books and articles on Java and have been teaching Java at the University level as a sideline for four years. In that time I've accumulated a great deal of "expert" knowledge about the language, the JVM, and the APIs and developed opinions on the best approaches to use in Java. At this point, reading books such as this that contain a collection of tips and advice I am usually satisfied to gain one new piece of knowledge; I learned at least six new things from this book. Of the 50+ books on Java I've read, this book contains by far the most comprehensive and useful collection of that hard-won knowledge of core Java. The bonus is the clear and concise manner in which it is presented. Bloch is dead-on. There isn't a single factual error or piece of bad advice... Read more
31 of 31 people found the following review helpful
By
This review is from: Effective Java: Programming Language Guide (Java Series) (Paperback)
I spend a lot of time thinking and talking about programming, languages, style, etc. This book is without question the best thing I've read about how to program in Java.The book contains 57 suggestions on what to do or not to do when writing Java code. Most are common sense, though not all -- the material on serialization was new to me, for example. But it's common sense that's developed over time, and much of it is not obvious until you have a lot of experience using the language. Even then, it's worth reading; I consider myself a fairly experienced Java programmer, and I'd say that a quarter of the book was new material for me. Even when I knew a technique he was recommending, it was really good to read the arguments Bloch made for doing something in a particular way. And I found that I agree with almost everything he wrote. The book is very Java-specific. Some of the tips generalize to other, similar, object-oriented languages, or to systems with similar thread models,... Read more
23 of 23 people found the following review helpful
By
This review is from: Effective Java: Programming Language Guide (Java Series) (Paperback)
IMHO, The Java Bible is out. It is that simple. I think this book deserves noless popularity and respect than "Effective C++" which set the high standard to the "Effective" series. It's definitely not a beginners book, this is the book that core Java developers It contains 57 issues covering topics about: |
› See all 120 customer reviews...
Praise For Effective Java™ Programming Language Guide
"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 release of the JDK library. A definite must-have for any JAVA developer/ programmer." - JavaRanch.com
"Effective Java is the best Java book in years and simply essential to every Java programmer from intermediate to advanced level…this book is incredibly informative and very well written." - Comp.Lang.Java. Programmer Newsgroup
"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.
"An excellent book, crammed with good advice on using the Java programming language and object-oriented programming in general." - Gilad Bracha, Computational Theologist, Sun Microsystems, Inc., and co-author of The Java Language Specification, Second Edition
"Effective Java Programming Language Guide is the best Java book in years and simply essential to every Java programmer from intermediate to advanced level…this book is incredibly informative and very well written."- comp.lang.java.programmer Newsgroup, August 2001
10/10 rating: "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 release of the JDK library. A definite must-have for any JAVA developer/programmer." - JavaRanch.com, August 2001
"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 release of the JDK library. A definite must-have for any JAVA developer/programmer." - JavaRanch.com, August 2001
"This is the Java book that I need...I tend to get caught up in the heat of the hack and slap stuff together that doesn’t stand the test of time. For me, one of the big values of the books is as something to re-read and remind myself of the True Path”-James Gosling, Fellow and Vice President, Sun Microsystems Inc., September 2001
“My favorite recently published book is Effective Java...This second generation book patterned after Meyer’s Effective C++ is aimed at intermediate to more advanced Java developers. It is filled with excellent examples and outstanding advice." -Richard S. Wiener, Editor, Journal of Object-Oriented Programming (JOOP), September 2001
"[This] is the book that James Gosling recommended to his conference-goers during his keynote address at JavaOne 2001...We can say upfront that this is an excellent book. In fact, compared to other books in the same league, this is one of the best so far...It is an excellent book and a must-read for serious Java programmers..."-DevX: Java Zone, September 2001
Online Sample Chapter
Table of Contents
Foreword.
Preface.
Acknowledgements.
1. Introduction.
2. Creating and Destroying Objects.
3. Methods Common to All Objects.
4. Classes and Interfaces.
5. Substitutes for C Constructs.
6. Methods.
7. General Programming.
8. Exceptions.
9. Threads.
10. Serialization.
References.
Index.
Preface
In 1996 I pulled up stakes and headed west to work for JavaSoft, as it was then known, because it was clear that was where the action was. In the intervening five years I've served as Java Platform Libraries Architect. I've designed, implemented and maintained many of the libraries, and served as a consultant for many others. Presiding over these libraries as the Java platform matured was a once-in-a-lifetime opportunity. It is no exaggeration to say that I had the privilege to work with some of the great software engineers of our generation. In the process, I learned a lot about the Java programming language--what works, what doesn't, and how to use the language and its libraries to best effect.
This book is my attempt to share my experience with you, so that you can imitate my successes while avoiding my failures. I borrowed the format from Scott Meyers's Effective C++ Meyers98, which consists of fifty items, each conveying one specific rule for improving your programs and designs. I found the format to be singularly effective and I hope you do too.
In many cases, I took the liberty of illustrating the items with real-world examples from the Java platform libraries. When describing something that could have been done better, I tried to pick on code that I wrote myself, but occasionally I pick on something written by a colleague. I sincerely apologize if, despite my best efforts, I've offended anyone. Negative examples are cited not to cast blame but in the spirit of cooperation, so that all of us can benefit from the experience of those who've gone before.
While this book is not targeted solely at developers of reusable components, it is inevitably colored by my experience writing such components over the past two decades. I naturally think in terms of exported APIs (Application Programming Interfaces) and I encourage you to do likewise. Even if you aren't developing reusable components, thinking in these terms tends to improve the quality of the software you write. Furthermore, it's not uncommon to write a reusable component without knowing it: you write something useful, share it with your buddy across the hall, and before long you have half a dozen users. At this point, you no longer have the flexibility to change the API at will, and are thankful for all the effort that you put into designing the API when you first wrote the software.
My focus on API design may seem a bit unnatural to devotees of the new lightweight software development methodologies, such as Extreme Programming Explained Beck99. These methodologies emphasize writing the simplest program that could possibly work. If you're using one of these methodologies you'll find that a focus on API design serves you well in the refactoring process. The fundamental goals of refactoring are the improvement of system structure and the avoidance of code duplication. These goals are impossible to achieve in the absence of well-designed APIs for the components of the system.
No language is perfect, but some of them are excellent. I have found the Java programming language and its libraries to be immensely conducive to quality and productivity, and a joy to work with. I hope this book captures my enthusiasm and helps make your use of the language more effective and enjoyable.
Josh Bloch
Cupertino, California
April, 2001
0201310058P04232001
Downloadable Sample Chapter
Click below for Sample Chapter related to this title:
blochch6.pdf
blochch7.pdf
ch7generalp.pdf
steeleforewordbloch.pdf
Index
A
- abstract classes
- adding an aspect to, 31
- as replacement for discriminated union, 101
- designing for inheritance, 82
- evolution of, vs. interfaces, 88
- examples
- adding behaviors to typesafe enum, 108
- replacement for discriminated union, 101
- skeletal implementation, 87
- static member class, 94
- replacement for discriminated union, 101
- for adding behaviors to typesafe enum, 108
- for service provider framework, 8
- for skeletal implementations, 82, 85
- noninstantiability and, 12
- vs. interfaces, 84-88
- as replacement for discriminated union, 101
- access control, 60
- access levels, 3
- method overriding and, 61
- of classes and interfaces, 60
- of constants, 61
- of members, 60
- of static member classes, 91
- readResolve and, 232
- of classes and interfaces, 60
- accessor methods, 98
- defensive copies and, 63, 124
- examples
- for failure-capture information, 173, 184
- for information returned by toString, 44
- for lower-level exception, 179
- immutability and, 63
- naming conventions for, 167
- vs. public fields, 98-99, 103
- examples
- alien methods, 196
- anonymous classes, 91, 93-94
- adding an aspect to, 31
Errata
Click below for Errata related to this title:
Errata
Book
This product currently is not for sale.
Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.

