📄 tij301.htm
字号:
<h2>
<a name="_Toc24775496"></a><a name="Heading777"></a>Preface to the
3<sup>rd</sup> edition</h2>
<p>Much of the motivation and effort for this edition is to bring the book up to date with the Java JDK 1.4 release of the language. However, it has also become clear that most readers use the book to get a solid grasp of the fundamentals so that they can move on to more complex topics. Because the language continues to grow, it became necessary—partly so that the book would not overstretch its bindings—to reevaluate the meaning of “fundamentals.” This meant, for example, completely rewriting the “Concurrency” chapter (formerly called “Multithreading”) so that it gives you a basic foundation in the core ideas of threading. Without that core, it’s hard to understand more complex issues of threading. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]A0655" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>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 system, you have no way of knowing if your code is reliable or not. To accomplish this in the book, a special unit testing framework was created to show and validate the output of each program. This was placed in Chapter 15, a new chapter, along with explanations of <i>ant</i> (the defacto standard Java build system, similar to <i>make</i>), JUnit (the defacto standard Java unit testing framework), and coverage of logging and assertions (new in JDK 1.4), along with an introduction to debugging and profiling. To encompass all these concepts, the new chapter is named “Discovering Problems,” and it introduces what I now believe are fundamental skills that all Java programmers should have in their basic toolkit. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]A0656" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>In addition, I’ve gone over every single example in the book and asked myself, “why did I do it this way?” In most cases I have done some modification and improvement, both to make the examples more consistent within themselves and also to demonstrate what I consider to be best practices in Java coding (at least, within the limitations of an introductory text). Examples that no longer made sense to me were removed, and new examples have been added. A number of the existing examples have had very significant redesign and reimplementation. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]A0657" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>The 16 chapters in this book produce what I think is a fundamental introduction to the Java language. The book can feasibly be used as an introductory course. But what about the more advanced material? <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]A0658" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>The original plan for the book was to add a new section covering the fundamentals of the “Java 2 Enterprise Edition” (J2EE). Many of these chapters would be created by my friends and associates who work with me on seminars and other projects, such as Andrea Provaglio, Bill Venners, Chuck Allison, Dave Bartlett, and Jeremy Meyer. When I looked at the progress of these new chapters, and the book deadline I began to get a bit nervous. Then I noticed that the size of the first 16 chapters was effectively the same as the size of the second edition of the book. And people sometimes complain this is already too big. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]A0659" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p><a name="Index1"></a>Readers have made many, many wonderful comments about the first two editions of this book, which has naturally been very pleasant for me. However, every now and then, someone will have complaints, and for some reason one complaint that comes up periodically is “the book is too big.” In my mind it is faint damnation indeed if “too many pages” is your only gripe. (One is reminded of the Emperor of Austria’s complaint about Mozart’s work: “Too many notes!” Not that I am in any way trying to compare myself to Mozart.) In addition, I can only assume that such a complaint comes from someone who is yet to be acquainted with the vastness of the Java language itself and has not seen the rest of the books on the subject. Despite this, one of the things I have attempted to do in this edition is trim out the portions that have become obsolete, or at least nonessential. In general, I’ve tried to go over everything, remove from the third edition what is no longer necessary, include changes, and improve everything I could. I feel comfortable removing portions because the original material remains on the Web site (<i>www.BruceEckel.com</i>) and the CD ROM that accompanies this book, in the form of the freely downloadable first and second editions of the book. If you want the old stuff, it’s still available, and this is a wonderful relief for an author. For example, the “<a name="Index2"></a>Design Patterns” chapter became too big and has been moved into a book of its own: <i>Thinking in Patterns (with Java) </i>(also downloadable at the Web site). <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Preface_10" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>I had already decided that when the next version of Java (JDK 1.5) is released from Sun, which will presumably include a major new topic called <i>generics</i> (inspired by C++ templates), I would have to split the book in two in order to add that new chapter. A little voice said “why wait?” So, I decided to do it for this edition, and suddenly everything made sense. I <i>was</i> trying to cram too much into an introductory book. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]A0660" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>The new book isn’t a second volume, but rather a more advanced topic. It will be called <a name="Index3"></a><i>Thinking in Enterprise Java</i>, and it is currently available (in some form) as a free download from <i>www.BruceEckel.com</i>. Because it is a separate book, it can expand to fit the necessary topics. The goal, like <i>Thinking in Java</i>, is to produce a very understandable coverage of the basics of the J2EE technologies so that the reader is prepared for more advanced coverage of those topics. You can find more details in Appendix C. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]A0661" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>For those of you who still can’t stand the size of the book, I do apologize. Believe it or not, I have worked hard to keep it small. Despite the bulk, I feel like there may be enough alternatives to satisfy you. For one thing, the book is available electronically, so if you carry your laptop, you can put the book on that and add no extra weight to your daily commute. If you’re really into slimming down, there are actually Palm Pilot versions of the book floating around. (One person told me he would read the book on his Palm in bed with the backlighting on to keep from annoying his wife. I can only hope that it helps send him to slumberland.) If you need it on paper, I know of people who print a chapter at a time and carry it in their briefcase to read on the train. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Preface_13" title="Send BackTalk Comment">Feedback</a></font><br></p>
<h2>
<a name="_Toc24775497"></a><a name="Heading787"></a>Java 2, JDK 1.4</h2>
<p>The releases of the Java JDK are numbered 1.0, 1.1, 1.2, 1.3, and for this book, 1.4. Although these version numbers are still in the “ones,” the standard way to refer to any version of the language that is JDK 1.2 or greater is to call it “Java 2.” This indicates the very significant changes between “old Java”—which had many warts that I complained about in the first edition of this book—and this more modern and improved version of the language, which has far fewer warts and many additions and nice designs. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Preface_14" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>This book is written for Java 2, in particular JDK 1.4 (much of the code will not compile with earlier versions, and the build system will complain and stop if you try). I have the great luxury of getting rid of all the old stuff and writing to only the new, improved language, because the old information still exists in the earlier editions, on the Web, and on the CD ROM. Also, because anyone can freely download the JDK from java.sun.com, it means that by writing to JDK 1.4, I’m not imposing a financial hardship on anyone by forcing them to upgrade. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Preface_15" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p><a name="Index4"></a>Previous versions of Java were slow in coming out for Linux (see <a name="Index5"></a><i>www.Linux.org</i>), but that seems to have been fixed, and new versions are released for Linux at the same time as for other platforms—now even the Macintosh is starting to keep up with more recent versions of Java. Linux is a very important development in conjunction with Java, because it is quickly becoming the most important server platform out there—fast, reliable, robust, secure, well-maintained, and free, it’s a true revolution in the history of computing (I don’t think we’ve ever seen all of those features in any tool before). And Java has found a very important niche in server-side programming in the form of <i>Servlets</i> and <i>JavaServer Pages</i> (JSPs), technologies that are huge improvements over the traditional <i>Common Gateway Interface</i> (CGI) programming (these and related topics are covered in <i>Thinking in Enterprise Java</i>). <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Preface_16" title="Send BackTalk Comment">Feedback</a></font><br></p>
<hr><p class="footnote text"><sup><a name="fn1" href="#fnB1">[1]</a></sup> I take this back on the 2<sup>nd</sup> edition: I believe that the Python language comes closest to doing exactly that. See www.Python.org.<br></p>
<!-- <hr><b>Placeholder</b> -->
<hr>
<div align="CENTER"><a href="TIJ3_t.htm" target="RightFrame"><img src="./prev.gif" alt="Previous " border="0"></a>
<a href="TIJ302.htm" target="RightFrame"><img src="./next.gif" alt="Next " border="0"></a>
<a href="TIJ3_t.htm"><img src="./first.gif" alt="Title Page " border="0"></a>
<a href="TIJ3_i.htm"><img src="./index.gif" alt="Index " border="0"></a>
<a href="TIJ3_c.htm"><img src="./contents.gif" alt="Contents " border="0"></a>
</div>
</font></body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -