Vous voulez voir cette page en français ? Cliquez ici.

Sign in to turn on 1-Click ordering.
Amazon Prime Free Trial required. Sign up when you check out. Learn More
More Buying Choices
Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Thinking in Java (4th Edition) [Paperback]

Bruce Eckel
1.0 out of 5 stars  See all reviews (1 customer review)
List Price: CDN$ 72.99
Price: CDN$ 45.76 & FREE Shipping. Details
You Save: CDN$ 27.23 (37%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 4 left in stock (more on the way).
Ships from and sold by Amazon.ca. Gift-wrap available.
Want it delivered Tuesday, April 22? Choose One-Day Shipping at checkout.

Book Description

Feb. 10 2006 0131872486 978-0131872486 4

Thinking in Java should be read cover to cover by every Java programmer, then kept close at hand for frequent reference. The exercises are challenging, and the chapter on Collections is superb! Not only did this book help me to pass the Sun Certified Java Programmer exam; it’s also the first book I turn to whenever I have a Java question.”
—Jim Pleger, Loudoun County (Virginia) Government
Much better than any other Java book I’ve seen. Make that ‘by an order of magnitude’.... Very complete, with excellent right-to-the-point examples and intelligent, not dumbed-down, explanations.... In contrast to many other Java books I found it to be unusually mature, consistent, intellectually honest, well-written, and precise. IMHO, an ideal book for studying Java.”
—Anatoly Vorobey, Technion University, Haifa, Israel
“Absolutely one of the best programming tutorials I’ve seen for any language.”
—Joakim Ziegler, FIX sysop
“Thank you again for your awesome book. I was really floundering (being a non-C programmer), but your book has brought me up to speed as fast as I could read it. It’s really cool to be able to understand the underlying principles and concepts from the start, rather than having to try to build that conceptual model through trial and error. Hopefully I will be able to attend your seminar in the not-too-distant future.”
—Randall R. Hawley, automation technician, Eli Lilly & Co.
“This is one of the best books I’ve read about a programming language.... The best book ever written on Java.”
—Ravindra Pai, Oracle Corporation, SUNOS product line
“Bruce, your book is wonderful! Your explanations are clear and direct. Through your fantastic book I have gained a tremendous amount of Java knowledge. The exercises are also fantastic and do an excellent job reinforcing the ideas explained throughout the chapters. I look forward to reading more books written by you. Thank you for the tremendous service that you are providing by writing such great books. My code will be much better after reading Thinking in Java. I thank you and I’m sure any programmers who will have to maintain my code are also grateful to you.”
—Yvonne Watkins, Java artisan, Discover Technologies, Inc.
“Other books cover the what of Java (describing the syntax and the libraries) or the how of Java (practical programming examples). Thinking in Java is the only book I know that explains the why of Java: Why it was designed the way it was, why it works the way it does, why it sometimes doesn’t work, why it’s better than C++, why it’s not. Although it also does a good job of teaching the what and how of the language, Thinking in Java is definitely the thinking person’s choice in a Java book.”
—Robert S. Stephenson
Awards for Thinking in Java
2003 Software Development Magazine Jolt Award for Best Book
2003 Java Developer’s Journal Reader’s Choice Award for Best Book
2001 JavaWorld Editor’s Choice Award for Best Book
2000 JavaWorld Reader’s Choice Award for Best Book
1999 Software Development Magazine Productivity Award
1998 Java Developer’s Journal Editor’s Choice Award for Best Book

Thinking in Java has earned raves from programmers worldwide for its extraordinary clarity, careful organization, and small, direct programming examples. From the fundamentals of Java syntax to its most advanced features, Thinking in Java is designed to teach, one simple step at a time.

  • The classic object-oriented introduction for beginners and experts alike, fully updated for Java SE5/6 with many new examples and chapters!
  • Test framework shows program output.
  • Design patterns are shown with multiple examples throughout: Adapter, Bridge, Chain of Responsibility, Command, Decorator, Facade, Factory Method, Flyweight, Iterator, Data Transfer Object, Null Object, Proxy, Singleton, State, Strategy, Template Method, and Visitor.
  • Introduction to XML for data transfer; SWT, Flash for user interfaces.
  • Completely rewritten concurrency chapter gives you a solid grasp of threading fundamentals.
  • 500+ working Java programs in 700+ compiling files, rewritten for this edition and Java SE5/6.
  • Companion web site includes all source code, annotated solution guide, weblog, and multimedia seminars.
  • Thorough coverage of fundamentals; demonstrates advanced topics.
  • Explains sound object-oriented principles.
  • Hands-On Java Seminar CD available online, with full multimedia seminar by Bruce Eckel.
  • Live seminars, consulting, and reviews available. See www.MindView.net

Download seven free sample chapters from Thinking in Java, Fourth Edition. Visit http://mindview.net/Books/TIJ4.

Frequently Bought Together

Thinking in Java (4th Edition) + Head First Java + Effective Java (2nd Edition)
Price For All Three: CDN$ 112.07

Show availability and shipping details

  • In Stock.
    Ships from and sold by Amazon.ca.
    FREE Shipping. Details

  • Head First Java CDN$ 29.78

    In Stock.
    Ships from and sold by Amazon.ca.
    FREE Shipping. Details

  • Effective Java (2nd Edition) CDN$ 36.53

    In Stock.
    Ships from and sold by Amazon.ca.
    FREE Shipping. Details

Customers Who Bought This Item Also Bought

Product Details

Product Description

About the Author

Bruce Eckel is president of MindView, Inc. (www.MindView.net), which provides public and private training seminars, consulting, mentoring, and design reviews in object-oriented technology and design patterns. He is the author of several books, has written more than fifty articles, and has given lectures and seminars throughout the world for more than twenty years. Bruce has served as a voting member of the C++ Standards Committee. He holds a B.S. in applied physics and an M.S. in computer engineering.

Excerpt. © Reprinted by permission. All rights reserved.

I originally approached Java as “just another programming language,” which in many senses it is.

But as time passed and I studied it more deeply, I began to see that the fundamental intent of this language was different from other languages I had seen up to that point.

Programming is about managing complexity: the complexity of the problem you want to solve, laid upon the complexity of the machine in which it is solved. Because of this complexity, most of our programming projects fail. And yet, of all the programming languages of which I am aware, almost none have gone all out and decided that their main design goal would be to conquer the complexity of developing and maintaining programs. 1 Of course, many language design decisions were made with complexity in mind, but at some point there were always other issues that were considered essential to be added into the mix. Inevitably, those other issues are what cause programmers to eventually “hit the wall” with that language. For example, C++ had to be backwards-compatible with C (to allow easy migration for C programmers), as well as efficient. Those are both very useful goals and account for much of the success of C++, but they also expose extra complexity that prevents some projects from being finished (certainly, you can blame programmers and management, but if a language can help by catching your mistakes, why shouldn’t it?). As another example, Visual BASIC (VB) was tied to BASIC, which wasn’t really designed to be an extensible language, so all the extensions piled upon VB have produced some truly unmaintainable syntax. Perl is backwards-compatible with awk, sed, grep, and other Unix tools it was meant to replace, and as a result it is often accused of producing “write-only code” (that is, after a while you can’t read it). On the other hand, C++, VB, Perl, and other languages like Smalltalk had some of their design efforts focused on the issue of complexity and as a result are remarkably successful in solving certain types of problems.

What has impressed me most as I have come to understand Java is that somewhere in the mix of Sun’s design objectives, it seems that there was a goal of reducing complexity for the programmer. As if to say, “We care about reducing the time and difficulty of producing robust code.” In the early days, this goal resulted in code that didn’t run very fast (although this has improved over time), but it has indeed produced amazing reductions in development time—half or less of the time that it takes to create an equivalent C++ program. This result alone can save incredible amounts of time and money, but Java doesn’t stop there. It goes on to wrap many of the complex tasks that have become important, such as multithreading and network programming, in language features or libraries that can at times make those tasks easy. And finally, it tackles some really big complexity problems: cross-platform programs, dynamic code changes, and even security, each of which can fit on your complexity spectrum anywhere from “impediment” to “show-stopper.” So despite the performance problems that we’ve seen, the promise of Java is tremendous: It can make us significantly more productive programmers.

In all ways—creating the programs, working in teams, building user interfaces to communicate with the user, running the programs on different types of machines, and easily writing programs that communicate across the Internet—Java increases the communication bandwidth between people.

I think that the results of the communication revolution may not be seen from the effects of moving large quantities of bits around. We shall see the true revolution because we will all communicate with each other more easily: one-on-one, but also in groups and as a planet. I’ve heard it suggested that the next revolution is the formation of a kind of global mind that results from enough people and enough interconnectedness. Java may or may not be the tool that foments that revolution, but at least the possibility has made me feel like I’m doing something meaningful by attempting to teach the language.

Java SE5 and SE6

This edition of the book benefits greatly from the improvements made to the Java language in what Sun originally called JDK 1.5, and then later changed to JDK5 or J2SE5, then finally they dropped the outdated “2” and changed it to Java SE5. Many of the Java SE5 language changes were designed to improve the experience of the programmer. As you shall see, the Java language designers did not completely succeed at this task, but in general they made large steps in the right direction.

One of the important goals of this edition is to completely absorb the improvements of Java SE5/6, and to introduce and use them throughout this book. This means that this edition takes the somewhat bold step of being “Java SE5/6-only,” and much of the code in the book will not compile with earlier versions of Java; the build system will complain and stop if you try. However, I think the benefits are worth the risk.

If you are somehow fettered to earlier versions of Java, I have covered the bases by providing free downloads of previous editions of this book via www.MindView.net. For various reasons, I have decided not to provide the current edition of the book in free electronic form, but only the prior editions.

Java SE6

This book was a monumental, time-consuming project, and before it was published, Java SE6 (code-named mustang) appeared in beta form. Although there were a few minor changes in Java SE6 that improved some of the examples in the book, for the most part the focus of Java SE6 did not affect the content of this book; the features were primarily speed improvements and library features that were outside the purview of this text.

The code in this book was successfully tested with a release candidate of Java SE6, so I do not expect any changes that will affect the content of this book. If there are any important changes by the time Java SE6 is officially released, these will be reflected in the book’s source code, which is downloadable from www.MindView.net.

The cover indicates that this book is for “Java SE5/6,” which means “written for Java SE5 and the very significant changes that version introduced into the language, but is equally applicable to Java SE6.”

The 4th edition

The satisfaction of doing a new edition of a book is in getting things “right,” according to what I have learned since the last edition came out. Often these insights are in the nature of the saying “A learning experience is what you get when you don’t get what you want,” and my opportunity is to fix something embarrassing or simply tedious. Just as often, creating the next edition produces fascinating new ideas, and the embarrassment is far outweighed by the delight of discovery and the ability to express ideas in a better form than what I have previously achieved.

There is also the challenge that whispers in the back of my brain, that of making the book something that owners of previous editions will want to buy. This presses me to improve, rewrite and reorganize everything that I can, to make the book a new and valuable experience for dedicated readers.


The CD-ROM that has traditionally been packaged as part of this book is not part of this edition. The essential part of that CD, the Thinking in C multimedia seminar (created for MindView by Chuck Allison), is now available as a downloadable Flash presentation. The goal of that seminar is to prepare those who are not familiar enough with C syntax to understand the material presented in this book. Although two of the chapters in this book give decent introductory syntax coverage, they may not be enough for people without an adequate background, and Thinking in C is intended to help those people get to the necessary level.

The Concurrency chapter (formerly called “Multithreading”) has been completely rewritten to match the major changes in the Java SE5 concurrency libraries, but it still gives you a basic foundation in the core ideas of concurrency. Without that core, it’s hard to understand more complex issues of threading. I spent many months working on this, immersed in that netherworld called “concurrency,” and in the end the chapter is something that not only provides a basic foundation but also ventures into more advanced territory.

There is a new chapter on every significant new Java SE5 language feature, and the other new features have been woven into modifications made to the existing material. Because of my continuing study of design patterns, more patterns have been introduced throughout the book as well.

The book has undergone significant reorganization. Much of this has come from the teaching process together with a realization that, perhaps, my perception of what a “chapter” was could stand some rethought. I have tended towards an unconsidered belief that a topic had to be “big enough” to justify being a chapter. But especially while teaching design patterns, I find that seminar attendees do best if I introduce a single pattern and then we immediately do an exercise, even if it means I only speak for a brief time (I discovered that this pace was also more enjoyable for me as a teacher). So in this version of the book I’ve tried to break chapters up by topic, and not worry about the resulting length of the chapters. I think it has been an improvement.

I have also come to realize the importance of code testing. Without a built-in test framework with tests that are run every time yo...

Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index
Search inside this book:

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

What Other Items Do Customers Buy After Viewing This Item?

Customer Reviews

5 star
4 star
3 star
2 star
1.0 out of 5 stars
1.0 out of 5 stars
Most helpful customer reviews
3 of 7 people found the following review helpful
1.0 out of 5 stars The authors thinks we're all rich Aug. 18 2010
By Mereo
One of the worst book I've read.

Yes, it explains Java as if it's a university course. But what I HATE about it is the fact you need to BUY the exercises SOLUTIONS!

I mean come on! I already brought the book for $55 and you want me to buy the solutions that should be FREE in order to LEARN?!

My suggestion? run AWAY from this book, it's not worth it.
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 4.0 out of 5 stars  66 reviews
26 of 28 people found the following review helpful
3.0 out of 5 stars Complete coverage, sheer drudgery, not a suitable first tutorial March 15 2006
By Moore Paul Patrick - Published on Amazon.com
[Note: this review refers to the 3rd edition. I haven't had access to the 4th edition to see what has changed.]

The summary says it all. This 1,000+ page monster probably has the best coverage of all the Java books purporting to be considered as introductory texts. In terms of completeness, it is better than the Sierra/Bates and Deitel books. However, these two books are much more approachable, with better layout and presentation, whereas working through this book is sheer drudgery.

The book uses extensive use of long examples to demonstrate the various language concepts and features. This approach IMO is very long-winded, and bumps up the size of the book to its present doorstop size. The coverage of inner and anonymous classes gets bogged down with the excessive use of example listings, while the treatment of the Java I/O System runs to 110 pages, and Collections to 120 pages, more than double that used by Deitel! A better approach IMO, as successfully used by Lippman in his popular C++ Primer, would have been to use small code fragments to demonstrate each point, and then present a more complete, compilable example at the end of each section or chapter. With free time a precious commodity, I want to learn new topics as quickly as possible, and learn the more esoteric details from more specialised sources later.

The presentation of the book could also be improved. As has already been mentioned by other reviewers, there is a dearth of diagrams to break up the monotony of the presentation. For example, Eckel makes occasional reference to design patterns in the text. Why not add UML diagrams to emphasise the point? Also, the coverage of the Java I/O Syetem, with its large collection of interrelated classes, simply cries out for a class diagram.

The book can be used as a very readable language reference. I should mention that Eckel's writing style itself is quite readable; a pity about the dour presentation. The on-line availability of the book is also a boon for searching particular topics.
19 of 21 people found the following review helpful
5.0 out of 5 stars If you are serious about learning Object Orientated Programming, then this is the book for you. Jan. 9 2007
By J. Nadir - Published on Amazon.com
Format:Paperback|Verified Purchase
This is not a beginner's book to programming, but if you have a little bit of programming experience and the desire to learn, this is the book for you. Thinking in Java helps you understand the thought process and concepts that the developers of Java had in mind when they developed the language. Bruce Eckel is a very experienced teacher and excellent communicator who is able to present the concepts in an understandable way. This is not for bedtime reading, you should have Java installed on your machine and interact with the book. Of course, nothing is better than attending a seminar by Mr. Eckel but this book comes pretty darn close. Don't bother with the "free" versions of this book's earlier editions, the Java Language has evolved and moved beyond them (Java added "generics" which is a major and painful language after-thought). It is clear that Mr. Eckel is not a fan of the way that Sun implemented Java (and I agree with him). But if you limit the use of Generics you can get by. If you are relatively new to programming and have the desire to learn, you should expect to spend at least three months crawling through this treasure book. It will be worth the effort. If you are an experienced programmer, this book will reveal the underlying concepts in a meaningful way to help you understand the differences between Java and C# and you can get through it in about a month. In addition, this book tries to show you how to organize your code for human readability (when properly done, your code almost reads like a human language - and please remember, I said "almost"). As a final comment, Java is a complex and verbose language (especially since Sun added generics) so this book will always be a good reference.
47 of 57 people found the following review helpful
2.0 out of 5 stars Seems specifically designed to confuse beginners. Sept. 17 2008
By Grant S. Robertson - Published on Amazon.com
Although this book purports to be written for anyone with even a little bit of prior programming experience, I am finding it very difficult to follow. This, even though I have been dabbling in programming since 1976 and I have gotten 'A's in several programming classes.

The author makes three major mistakes all throughout the book:

First, he uses compressed code formating that makes it difficult to see where one part of the code ends and another starts. I know it is common for advanced programmers and authors trying to save paper to use this format, but it should not be used in a book for beginning Java programmers. I spend more time just trying to sort out which curly bracket matches to which curly bracket than anything else in trying to read his code.

Second, he continuously uses advanced techniques and Java features in sample code meant to illustrate beginning concepts. This leaves the reader confused about what the code is doing at all and forces them to simply take on faith that what the author says about the code is true. For instance, in the section titled "Your first Java Program" (page 78) the author instantiates an anonymous object and passes it to a method. There was no reason to include this line of code. But the author stuck it in there and then waved his hands at it saying merely, "The argument is a Date object that is being created just to send its va1ue (which is automatically converted to a String) to println(). As soon as this statement is finished, that Date is unnecessary, and the garbage collector can come along and get it anytime. We don't need to worry about cleaning it up." In those few sentences the author has made reference to several more advanced features without even explaining them. So, in trying to understand that one unnecessary line of the reader is spun off on at least three different tangents.
The next sample program is even worse. The very first line that actually does anything is " System.getProperties().list(System.out); " Holy cow! The System.getProperties() method returns a Properties object which is an extension of the Hashtable class. Then the second dot operator calls the list method for Properties object that has "replaced" the System.getProperties() part of the code as far as the second dot operator is concerned. The list() method then accepts as an argument a static PrintStream object which the list() method then sends its output to. And the author says merely, "The first line in main( ) displays all of the "properties" from the system where you are running the program, so it gives you environment information. The list() method sends the results to its argument, System.out." But to someone who is only just now reading this page in the book, "System.out" is how you print something, NOT something that can be passed as an argument. And have you ever tried to Google a period (.)? How is a beginner supposed to figure out that the list() method is a member of the Properties object that was returned by the System.getProperties() method. Sure, you can dig it out of the JavaDocs but a beginner won't be able to do this easily. Besides, if you are going to force the reader to dig everything out of the JavaDocs then what the heck is the book good for?
This same pattern is repeated throughout the book. Every single example has something in it that is more advanced than a person who has gotten to that part of the book could reasonably be expected to be able to figure out.

Finally, the biggest problem with this book is that the author has created his own set of libraries and uses them heavily in his code but doesn't indicate where. So, if you don't have the entire JDK memorized you have no clue when he is using something from the standard libraries or something from his own libraries. If you are trying to learn the basics of Java, you don't want to have some other stuff mixed in at random. Sure, the author's libraries may solve some interesting problems and it may make some things easier to code. But it DOES NOT teach the reader about how Java works other than it is possible to completely obfuscate everything you do.

So, my conclusion is that this book is really good for nothing. It is too confusing for the beginner and is way too wordy for an expert. Intermediate users will spend more time digging through the JavaDocs than they do reading the book.
13 of 15 people found the following review helpful
5.0 out of 5 stars The best. Aug. 14 2006
By Bogus Exception - Published on Amazon.com
I'll make this short. I depend a LOT on buyer reviews on Amazon to help me decide what to get. This book is the best book on Java, taking the reader from the basics right up to the sexy stuff in J2SE5 like queues and generics.

This is the book that my 20+ other Java books are judged against.
10 of 11 people found the following review helpful
4.0 out of 5 stars For Beginners - BAD ! 2-nd time around - GREAT March 18 2006
By Joseph B. Cohen - Published on Amazon.com
This is NOT a beginner's book. The sheer size of this weighty tome is overwhelming, and it does not come with rollers. It is a great book for your second pass thru Java, certainly more so than any other book that I've looked at. I have extensive teaching experience and I do spend lots of time examing books. Eckel is a very readable and much more than competent writer as attested to by the great sucess with his previous C and C++ books. They are still great reading and studying books. For Java starters, you can't do much better than the Sierra and Bates book, 'HeadFirst Java' from O'Reilly. (By the way, at good price from Amazon). Check out their newest, Design Patterns in Java. Everything in the 4th edition of this now classic Eckel book looks more polished. In agreement with other reviewers, this book lacks a polished publishing job. Where are the pictures ? A little UML might be nice. Can we get a nicer font and less huge margins.

This review is dedicated to the memory of the Sahara Forest.
Search Customer Reviews
Only search this product's reviews

Look for similar items by category