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


or
Sign in to turn on 1-Click ordering.
More Buying Choices
Have one to sell? Sell yours here
Thinking in Java
 
 

Thinking in Java [Paperback]

Bruce Eckel
4.2 out of 5 stars  See all reviews (269 customer reviews)
List Price: CDN$ 72.99
Price: CDN$ 45.76 & this item ships for FREE with Super Saver 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
In Stock.
Ships from and sold by Amazon.ca. Gift-wrap available.
Only 2 left in stock--order soon (more on the way).
Want it delivered Tuesday, May 29? Choose One-Day Shipping at checkout.
‹  Return to Product Overview

Product Description

From Amazon

Perfect for migrating to Java from a fellow object-oriented language (such as C++), the second edition of Thinking in Java continues the earlier version's thoughtful approach to learning Java inside and out, while also bringing it up to speed with some of the latest in Java 2 features. This massive tutorial covers many of the nooks and crannies of the language, which is of great value in the programming world.

The most prominent feature of the book is its diligent and extremely thorough treatment of the Java language, with special attention to object design. (For instance, 10 pages of sample code show all of the available operators.) Some of the best thinking about objects is in this book, including when to use composition over inheritance. The esoteric details of Java in regard to defining classes are thoroughly laid out. (The material on interfaces, inner classes, and designing for reuse will please any expert.) Each section also has sample exercises that let you try out and expand your Java knowledge.

Besides getting the reader to "think in objects," Thinking in Java also covers other APIs in Java 2. Excellent sections include an in-depth tour of Java's collection and stream classes, and enterprise-level APIs like servlets, JSPs, EJBs, and RMI. Weighing in at over 1,000 pages, any reader who is serious about learning Java inside and out will want to take a look at this superior resource on some of the latest and most advanced thinking in object design. --Richard Dragan

Topics covered:
  • Object-design basics
  • Inheritance and polymorphism
  • Object lifetimes
  • Exception handling
  • Multithreading and persistence
  • Java on the Internet
  • Analysis and design basics
  • Java basics: keywords and flow control
  • Initializing objects
  • Garbage collection
  • Java packages
  • Designing for reuse: composition vs. inheritance
  • The final keyword
  • Interfaces and inner classes
  • Arrays and container classes

  • Java I/O classes
  • Run-time type identification
  • UI design basics with Swing
  • Deploying to JAR files
  • Network programming with sockets
  • JDBC database programming
  • Introduction to servlets
  • JavaServer Pages (JSPs)
  • RMI
  • CORBA
  • Enterprise JavaBeans (EJBs) and Jini
  • Cloning objects
  • The Java Native Interface (JNI)
  • Java programming guidelines
  • --This text refers to an out of print or unavailable edition of this title.

    Review

    "This book is a tremendous achievement. You owe it to yourself to have a copy on your shelf. The chapter on iostreams is the most comprehensive and understandable treatment of that subject Ive seen to date." - Al Stevens Contributing Editor, Doctor Dobbs Journal" Eckels book is the only one to so clearly explain how to rethink program construction for object orientation. That the book is also an excellent tutorial on the ins and outs of C++ is an added bonus." - Andrew Binstock Editor, Unix Review"Bruce continues to amaze me with his insight into C++, and Thinking in C++ is his best collection of ideas yet. If you want clear answers to difficult questions about C++, buy this outstanding book." - Gary Entsminger Author, The Tao of Objects"Thinking in C++ patiently and methodically explores the issues of when and how to use inlines, references, operator overloading, inheritance, and dynamic objects, as well as advanced topics such as the proper use of templates, exceptions and multiple inheritance. The entire effort is woven in a fabric that includes Eckels own philosophy of object and program design. A must for every C++ developers bookshelf, Thinking in C++ is the one C++ you must have if youre doing serious development with C++." - Richard Hale Shaw Contributing Editor, PC Magazine --This text refers to an out of print or unavailable edition of this title.

    Book Description

    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.

    From the Inside Flap

    PrefacePreface

    I suggested to my brother Todd,who is making the leap from hardware into programming, that the next bigrevolution will be in genetic engineering.

    We'll have microbes designed tomake food, fuel, and plastic; they'll clean up pollution and in generalallow us to master the manipulation of the physical world for a fraction of whatit costs now. I claimed that it would make the computer revolution look small incomparison.

    Then I realized I was making a mistakecommon to science fiction writers: getting lost in the technology (which is ofcourse easy to do in science fiction). An experienced writer knows that thestory is never about the things; it's about the people. Genetics will havea very large impact on our lives, but I'm not so sure it will dwarf thecomputer revolution (which enables the genetic revolution)—or at least theinformation revolution. Information is about talking to each other: yes, carsand shoes and especially genetic cures are important, but in the end those arejust trappings. What truly matters is how we relate to the world. And so much ofthat is about communication.

    This book is a case in point. A majorityof folks thought I was very bold or a little crazy to put the entire thing up onthe Web. "Why would anyone buy it?" they asked. If I had been of amore conservative nature I wouldn't have done it, but I reallydidn't want to write another computer book in the same old way. Ididn't know what would happen but it turned out to be the smartest thingI've ever done with a book.

    For one thing, people started sending incorrections. This has been an amazing process, because folks have looked intoevery nook and cranny and caught both technical and grammatical errors, andI've been able to eliminate bugs of all sorts that I know would haveotherwise slipped through. People have been simply terrific about this, veryoften saying "Now, I don't mean this in a critical way..." andthen giving me a collection of errors I'm sure I never would have found. Ifeel like this has been a kind of group process and it has really made the bookinto something special.

    But then I started hearing "OK,fine, it's nice you've put up an electronic version, but I want aprinted and bound copy from a real publisher." I tried very hard to makeit easy for everyone to print it out in a nice looking format but thatdidn't stem the demand for the published book. Most people don'twant to read the entire book on screen, and hauling around a sheaf of papers, nomatter how nicely printed, didn't appeal to them either. (Plus, I thinkit's not so cheap in terms of laser printer toner.) It seems that thecomputer revolution won't put publishers out of business, after all.However, one student suggested this may become a model for future publishing:books will be published on the Web first, and only if sufficient interestwarrants it will the book be put on paper. Currently, the great majority of allbooks are financial failures, and perhaps this new approach could make thepublishing industry more profitable.

    This book became an enlighteningexperience for me in another way. I originally approached Java as "justanother programming language," which in many senses it is. But as timepassed and I studied it more deeply, I began to see that the fundamentalintention of this language is different from all the other languages I haveseen.

    Programming is about managing complexity:the complexity of the problem you want to solve, laid upon the complexity of themachine in which it is solved. Because of this complexity, most of ourprogramming projects fail. And yet, of all the programming languages of which Iam aware, none of them have gone all-out and decided that their main design goalwould be to conquer the complexity of developing and maintainingprograms.1 Ofcourse, many language design decisions were made with complexity in mind, but atsome point there were always some other issues that were considered essential tobe added into the mix. Inevitably, those other issues are what cause programmersto eventually "hit the wall" with that language. For example, C++had to be backwards-compatible with C (to allow easy migration for Cprogrammers), as well as efficient. Those are both very useful goals and accountfor much of the success of C++, but they also expose extra complexity thatprevents some projects from being finished (certainly, you can blame programmersand management, but if a language can help by catching your mistakes, whyshouldn't it?). As another example, Visual Basic (VB) was tied to BASIC,which wasn't really designed to be an extensible language, so all theextensions piled upon VB have produced some truly horrible and unmaintainablesyntax. Perl is backwards-compatible with Awk, Sed, Grep, and other Unix toolsit was meant to replace, and as a result is often accused of producing"write-only code" (that is, after a few months you can't readit). On the other hand, C++, VB, Perl, and other languages like Smalltalk hadsome of their design efforts focused on the issue of complexity and as a resultare remarkably successful in solving certain types of problems.

    What has impressed me most as I have cometo understand Java is what seems like an unflinching goal of reducing complexityfor the programmer. As if to say "we don't care aboutanything except reducing the time and difficulty of producing robustcode." In the early days, this goal has resulted in code thatdoesn't run very fast (although there have been many promises made abouthow quickly Java will someday run) but it has indeed produced amazing reductionsin development time; half or less of the time that it takes to create anequivalent C++ program. This result alone can save incredible amounts of timeand money, but Java doesn't stop there. It goes on to wrap all the complextasks that have become important, such as multithreading and networkprogramming, in language features or libraries that can at times make thosetasks trivial. And finally, it tackles some really big complexity problems:cross-platform programs, dynamic code changes, and even security, each of whichcan fit on your complexity spectrum anywhere from "impediment" to"show-stopper." So despite the performance problems we'veseen, the promise of Java is tremendous: it can make us significantly moreproductive programmers.

    One of the places I see the greatestimpact for this is on the Web. Network programming has always been hard, andJava makes it easy (and the Java language designers are working on making iteven easier). Network programming is how we talk to each other more effectivelyand cheaper than we ever have with telephones (email alone has revolutionizedmany businesses). As we talk to each other more, amazing things begin to happen,possibly more amazing even than the promise of geneticengineering.

    In all ways—creating the programs,working in teams to create the programs, building user interfaces so theprograms can communicate with the user, running the programs on different typesof machines, and easily writing programs that communicate across theInternet—Java increases the communication bandwidth between people.I think that perhaps the results of the communication revolution will not beseen from the effects of moving large quantities of bits around; we shall seethe true revolution because we will all be able to talk to each other moreeasily: one-on-one, but also in groups and, as a planet. I've heard it suggestedthat the next revolution is the formation of a kind of global mind that resultsfrom enough people and enough interconnectedness. Java may or may not be thetool that foments that revolution, but at least the possibility has made me feellike I'm doing something meaningful by attempting to teach thelanguage.Preface to the 2nd edition

    People have made many, many wonderfulcomments about the first edition of this book, which has naturally been verypleasant for me. However, every now and then someone will have complaints, andfor some reason one complaint that comes up periodically is "the book istoo big." In my mind it is faint damnation indeed if "too manypages" is your only complaint. (One is reminded of the Emperor ofAustria's complaint about Mozart's work: "Too manynotes!" Not that I am in any way trying to compare myself to Mozart.) Inaddition, I can only assume that such a complaint comes from someone who is yetto be acquainted with the vastness of the Java language itself, and has not seenthe rest of the books on the subject—for example, my favorite reference isCay Horstmann & Gary Cornell's Core Java (Prentice-Hall), whichgrew so big it had to be broken into two volumes. Despite this, one of thethings I have attempted to do in this edition is trim out the portions that havebecome obsolete, or at least nonessential. I feel comfortable doing this becausethe original material remains on the Web site and the CD ROM that accompaniesthis book, in the form of the freely-downloadable first edition of the book (atBruceEckel). If you want the old stuff, it's still there,and this is a wonderful relief for an author. For example, you may notice thatthe original last chapter, "Projects," is no longer here; two of theprojects have been integrated into other chapters, and the rest were no longerappropriate. Also, the "Design Pattens" chapter became too big andhas been moved into a book of its own (also downloadable at the Web site). So,by all rights the book should be thinner.

    But alas, it is not tobe.

    The biggest issue is the continuingdevelopment of the Java language itself, and in particular the expanding APIsthat promise to provide standard interfaces for just about everythingyou'd like to do (and I won't be surprised to see the"JToaster" API eventually appear). Covering all these APIs isobviously beyond the scope of this book and is a task relegated to otherauthors, but some issues cannot be ignored. The biggest of these includeserver-side Java (primarily Servlets & Java Server pages, or JSPs),which is truly an excellent solution to the World Wide Web problem, whereinwe've discovered that the various Web browser platforms are just notconsistent enough to support client-side programming. In addition, there is thewhole problem of easily creating applications to interact with databases,transactions, security, and the like, which is involved with Enterprise JavaBeans (EJBs). These topics are wrapped into the chapter formerly called"Network Programming" and now called "DistributedComputing," a subject that is becoming essential to everyone. You'llalso find this chapter has been expanded to include an overview of Jini(pronounced "genie," and it isn't an acronym, just a name),which is a cutting-edge technology that allows us to change the way we thinkabout interconnected applications. And of course the book has been changed touse the Swing GUI library throughout. Again, if you want the old Java 1.0/1.1stuff you can get it from the freely-downloadable book atBruceEckel (it is also included on this edition's new CDROM, bound into the book; more on that a little later).

    Aside from additional small languagefeatures added in Java 2 and corrections made throughout the book, the othermajor change is in the collections chapter (9), which now focuses on the Java 2collections used throughout the book. I've also improved that chapter tomore deeply go into some of the important issues of collections, in particularhow a hash function works (so that you can know how to properly create one).There have been other movements and changes, including a rewrite of Chapter 1,and removal of some appendices and other material that I consider no longernecessary for the printed book, but those are the bulk of them. In general,I've tried to go over everything, remove from the 2nd editionwhat is no longer necessary (but which still exists in the electronic firstedition), include changes, and improve everything I could. As the languagecontinues to change—albeit not quite at the same breakneck pace asbefore—there will no doubt be further editions of thisbook.

    For those of you who still can'tstand the size of the book, I do apologize. Believe it or not, I have workedhard to keep it small. Despite the bulk, I feel like there may be enoughalternatives to satisfy you. For one thing, the book is available electronically(from the Web site, and also on the CD ROM that accompanies this book), so ifyou carry your laptop you can carry the book on that with no extra weight. Ifyou're really into slimming down, there are actually Palm Pilot versionsof the book floating around. (One person told me he would read the book in bedon his Palm with the backlighting on to keep from annoying his wife. I can onlyhope that it helps send him to slumberland.) If you need it on paper, I know ofpeople who print a chapter at a time and carry it in their briefcase to read onthe train.Java 2

    At this writing, the release ofSun's Java Development Kit (JDK) 1.3 is imminent, and the proposedchanges for JDK 1.4 have been publicized. Although these version numbers arestill in the "ones," the standard way to refer to any version of thelanguage that is JDK 1.2 or greater is to call it "Java 2." Thisindicates the very significant changes between "oldJava"—which had many warts that I complained about in the firstedition of this book—and this more modern and improved version of thelanguage, which has far fewer warts and many additions and nicedesigns.

    This book is written for Java 2. I havethe great luxury of getting rid of all the old stuff and writing to only thenew, improved language because the old information still exists in theelectronic 1st edition on the Web and on the CD ROM (which is whereyou can go if you're stuck using a pre-Java-2 version of the language).Also, because anyone can freely download the JDK from java.sun, it meansthat by writing to Java 2 I'm not imposing a financial hardship on someoneby forcing them to upgrade.

    There is a bit of a catch, however. JDK1.3 has some improvements that I'd really like to use, but the version ofJava that is currently being released for Linux is JDK 1.2.2. Linux (seeLinux) is a very important development in conjunction with Java, becauseit is fast becoming the most important server platform out there—fast,reliable, robust, secure, well-maintained, and free, a true revolution in thehistory of computing (I don't think we've ever seen all of thosefeatures in any tool before). And Java has found a very important niche inserver-side programming in the form of Servlets, a technology that is ahuge improvement over the traditional CGI programming (this is covered in the"Distributed Programming" chapter).

    So although I would like to only use thevery newest features, it's critical that everything compiles under Linux,and so when you unpack the source code and compile it under that OS (with thelatest JDK) you'll discover that everything will compile. However, youwill find that I've put notes about features in JDK 1.3 here andthere.The CD ROM

    Another bonus with this edition is the CDROM that is packaged in the back of the book. I've resisted putting CDROMs in the back of my books in the past because I felt the extra charge for afew Kbytes of source code on this enormous CD was not justified, preferringinstead to allow people to download such things from my Web site. However,you'll soon see that this CD ROM is different.

    The CD does contain the source code fromthe book, but it also contains the book in its entirety, in several electronicformats. My favorite of these is the HTML format, because it is fast and fullyindexed—you just click on an entry in the index or table of contents andyou're immediately at that portion of the book.

    The bulk of the 300+ Megabytes of the CD,however, is a full multimedia course called Thinking in C: Foundations forC++ & Java. I originally commissioned Chuck Allison to create thisseminar-on-CD ROM as a stand-alone product, but decided to include it with thesecond editions of both Thinking in C++ and Thinking in Javabecause of the consistent experience of having people come to seminars withoutan adequate background in C. The thinking apparently goes "I'm asmart programmer and I don't want to learn C, but rather C++ orJava, so I'll just skip C and go directly to C++/Java." Afterarriving at the seminar, it slowly dawns on folks that the prerequisite ofunderstanding C syntax is there for a very good reason. By including the CD ROMwith the book, we can ensure that everyone attends a seminar with adequatepreparation.

    The CD also allows the book to appeal toa wider audience. Even though Chapter 3 (Controlling program flow) does coverthe fundamentals of the parts of Java that come from C, the CD is a gentlerintroduction, and assumes even less about the student's programmingbackground than does the book. It is my hope that by including the CD morepeople will be able to be brought into the fold of Javaprogramming.

    1I take this back on the 2nd edition: I believe that the Pythonlanguage comes closest to doing exactly that. SeePython
    --This text refers to an out of print or unavailable edition of this title.

    From the Back Cover

    The Definitive Introduction to Object-Oriented Programming in the Language of the World-Wide Web

    Full text updates and code at HTTP://WWW.BRUCEECKEL.COM

    JavaWorld Reader's Choice Award for best book, 2000
    Java Developer's Journal Editor's Choice Award for best book, 1999
    Software Development Magazine Productivity Award, 1999

    From the fundamentals of Java syntax to its most advanced features (distributed computing, advanced object-oriented capabilities, multithreading), "Thinking in Java" is designed to teach. Bruce Eckel's readable style and small, direct programming examples make even the most arcane concepts clear.

    • Java 2 only!
    • First edition covering Java 1 on CD ROM and downloadable from www.BruceEckel.com
    • For beginners and experts alike.
    • Teaches Java linguistics, not platform-dependent mechanics.
    • Thorough coverage of fundamentals, demonstrates advanced topics.
    • 300+ working Java programs, 15,000+ lines of code.
    • Source code on the CD and downloadable.
    • Explains sound object-oriented principles as they apply to Java.
    • From an independent voice, award-winning author Bruce Eckel.
    • Regular updates of this book available of this book available online.
    • Companion CD with more than 15 hours of audio lectures by Bruce Eckel available online.
    • Live seminars available. See schedule at www.BruceEckel.com

    What People Are Saying: "The best book on Java... Your depth is amazing," "Definitely the thinking person's choice in a Java book," "One of the absolutely best programming tutorials I've seen, for any language."

    --This text refers to an out of print or unavailable edition of this title.

    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.

    Changes

    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 you do a build of your ...

    ‹  Return to Product Overview

    Amazon.ca Privacy Statement Amazon.ca Shipping Information Amazon.ca Returns & Exchanges