⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tij302.htm

📁 这也是我们java老师给我们的thinking in java的一些资料
💻 HTM
📖 第 1 页 / 共 5 页
字号:
“toy examples,” but I’m willing to accept that in favor of
producing something pedagogically useful. <font size="-2"><a
href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_32" title="Send BackTalk
Comment">Feedback</a></font></li>
<li>Carefully sequence the presentation of features so that you&#146;re exposed
to a topic before you see it in use. Of course, this isn&#146;t always
possible; in those situations, a brief introductory description is given. <font
size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_33" title="Send
BackTalk Comment">Feedback</a></font></li>
<li>Give you what I think is important for you to understand about the language,
rather than everything I know. I believe there is an information importance
hierarchy, and that there are some facts that 95 percent of programmers will
never need to know&#151;details that just confuse people and increase their
perception of the complexity of the language. To take an example from C, if you
memorize the operator precedence table (I never did), you can write clever code.
But if you need to think about it, it will also confuse the reader/maintainer of
that code. So forget about precedence, and use parentheses when things
aren&#146;t clear. <font size="-2"><a
href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_34" title="Send BackTalk
Comment">Feedback</a></font></li>
<li>Keep each section focused enough so that the lecture time&#151;and the time
between exercise periods&#151;is small. Not only does this keep the
audience&#146;s minds more active and involved during a hands-on seminar, but
it gives the reader a greater sense of accomplishment. <font size="-2"><a
href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_35" title="Send BackTalk
Comment">Feedback</a></font></li>
<li>Provide you with a solid foundation so that you can understand the issues
well enough to move on to more difficult coursework and books. <font
size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_36" title="Send
BackTalk Comment">Feedback</a></font></li></ol><h2>
<a name="_Toc312373772"></a><a name="_Toc375545180"></a><a name="_Toc24775502"></a><a name="Heading815"></a>JDK
HTML documentation</h2>
<p>The Java language and libraries from Sun Microsystems (a free download from <i>java.sun.com</i>) come with documentation in electronic form, readable using a Web browser, and virtually every third-party implementation of Java has this or an equivalent documentation system. Almost all the books published on Java have duplicated this documentation. So you either already have it or you can download it, and unless necessary, this book will not repeat that documentation, because it&#146;s usually much faster if you find the class descriptions with your Web browser than if you look them up in a book (and the on-line documentation is probably more up-to-date). You&#146;ll simply be referred to &#147;the JDK documentation.&#148; This book will provide extra descriptions of the classes only when it&#146;s necessary to supplement that documentation so you can understand a particular example. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_37" title="Send BackTalk Comment">Feedback</a></font><br></p>
<h2>
<a name="Index10"></a><a name="_Toc24775503"></a><a name="Heading817"></a>Chapters</h2>
<p>This book was designed with one thing in mind: the way people learn the Java language. Seminar audience feedback helped me understand the difficult parts that needed illumination. In the areas where I got ambitious and included too many features all at once, I came to know&#151;through the process of presenting the material&#151;that if you include a lot of new features, you need to explain them all, and this easily compounds the student&#146;s confusion. As a result, I&#146;ve taken a great deal of trouble to introduce the features as few at a time as possible. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_38" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>The goal, then, is for each chapter to teach a single feature, or a small group of associated features, without relying on features that haven&#146;t been introduced yet. That way you can digest each piece in the context of your current knowledge before moving on. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_39" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>Here is a brief description of the chapters contained in the book, that correspond to lectures and exercise periods in the <i>Thinking in Java</i> seminar. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_40" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p class="EmphasisP"><b><i>Chapter 1:	Introduction to Objects</i></b><br></p>
<p class="Body Text Indent 2">(<i>Corresponding lecture on the CD ROM</i>). This chapter is an overview of what object-oriented programming is all about, including the answer to the basic question &#147;What is an object?&#148; It looks at interface versus implementation, abstraction and encapsulation, messages and methods, inheritance and composition, and the subtle concept of polymorphism. You&#146;ll also get an overview of issues of object creation such as constructors, where the objects live, where to put them once they&#146;re created, and the magical garbage collector that cleans up the objects that are no longer needed. Other issues will be introduced, including error handling with exceptions, multithreading for responsive user interfaces, and networking and the Internet. You&#146;ll learn what makes Java special and why it&#146;s been so successful. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]A0544" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p class="EmphasisP"><b><i>Chapter 2:	Everything is an Object</i></b><br></p>
<p>(<i>Corresponding lecture on the CD ROM</i>). This chapter moves you to the point where you can write your first Java program. It begins with an overview of the essentials: the concept of a <i>reference</i> to an object; how to create an object; an introduction to primitive types and arrays; scoping and the way objects are destroyed by the garbage collector; how everything in Java is a new data type (class); the basics of creating your own classes; methods, arguments, and return values; name visibility and using components from other libraries; the <b>static</b> keyword; and comments and embedded documentation. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_41" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p class="EmphasisP"><b><i>Chapter 3:	Controlling Program Flow</i></b><br></p>
<p>(<i>Corresponding set of lectures on the CD ROM: Thinking in C</i>). This chapter begins with all of the operators that come to Java from C and C++. In addition, you&#146;ll discover common operator pitfalls, casting, promotion, and precedence. This is followed by the basic control-flow and selection operations that you get with virtually any programming language: choice with <b>if</b>-<b>else</b>, looping with <b>for</b> and <b>while</b>, quitting a loop with <b>break</b> and <b>continue</b> as well as Java&#146;s labeled <b>break</b> and labeled <b>continue</b> (which account for the &#147;missing goto&#148; in Java), and selection using <b>switch</b>. Although much of this material has common threads with C and C++ code, there are some differences. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_42" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p class="EmphasisP"><b><i>Chapter 4:	Initialization &amp; Cleanup</i></b><br></p>
<p>(<i>Corresponding lecture on the CD ROM</i>). This chapter begins by introducing the constructor, which guarantees proper initialization. The definition of the constructor leads into the concept of method overloading (since you might want several constructors). This is followed by a discussion of the process of cleanup, which is not always as simple as it seems. Normally, you just drop an object when you&#146;re done with it, and the garbage collector eventually comes along and releases the memory. This portion explores the garbage collector and some of its idiosyncrasies. The chapter concludes with a closer look at how things are initialized: automatic member initialization, specifying member initialization, the order of initialization, <b>static</b> initialization, and array initialization. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_43" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p class="EmphasisP"><b><i>Chapter 5:	Hiding the Implementation</i></b><br></p>
<p>(<i>Corresponding lecture on the CD ROM</i>). This chapter covers the way that code is packaged together, and why some parts of a library are exposed while other parts are hidden. It begins by looking at the <b>package</b> and <b>import</b> keywords, that perform file-level packaging and allow you to build libraries of classes. It then examines the subject of directory paths and file names. The remainder of the chapter looks at the <b>public</b>, <b>private,</b> and <b>protected</b> keywords, the concept of <i>package access</i>, and what the different levels of access control mean when used in various contexts. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_44" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p class="EmphasisP"><b><i>Chapter 6:	Reusing Classes </i></b><br></p>
<p>(<i>Corresponding lecture on the CD ROM</i>). The simplest way to reuse a class is to embed an object inside your new class with <i>composition</i>. However, composition isn&#146;t the only way to make new classes from existing ones. The concept of inheritance is standard in virtually all OOP languages. It&#146;s a way to take an existing class and add to its functionality (as well as change it&#151;the subject of Chapter 7). Inheritance is often a way to reuse code by leaving the &#147;base class&#148; the same and just patching things here and there to produce what you want. In this chapter you&#146;ll learn how composition and inheritance reuse code in Java, and how to apply them. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_45" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p class="EmphasisP"><b><i>Chapter 7:	Polymorphism</i></b><br></p>
<p>(<i>Corresponding lecture on the CD ROM</i>). On your own, you might take nine months to discover and understand polymorphism, a cornerstone of OOP. Through small, simple examples, you&#146;ll see how to create a family of types with inheritance and manipulate objects in that family through their common base class. Java&#146;s polymorphism allows you to treat all objects in this family generically, which means that the bulk of your code doesn&#146;t rely on specific type information. This makes your code more flexible, so building programs and code maintenance is easier and cheaper. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_46" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p class="EmphasisP"><b><i>Chapter 8:	Interfaces &amp; Inner Classes</i></b><br></p>
<p>Java provides special tool to set up design and reuse relationships: the <i>interface</i>, which is a pure abstraction of the interface of an object. The <b>interface </b>is more than just an abstract class taken to the extreme, since it allows you to perform a variation on C++&#146;s &#147;multiple inheritance&#148; by creating a class that can be upcast to more than one base type. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_47" title="Send BackTalk Comment">Feedback</a></font><br></p>
<p>At first, inner classes look like a simple code-hiding mechanism; you place classes inside other classes. You&#146;ll learn, however, that the inner class does more than that; it knows about and can communicate with the surrounding class. The kind of code you can write with inner classes is more elegant and clear. However, it is a new concept to most, and it takes some time to become comfortable with design using inner classes. <font size="-2"><a href="mailto:TIJ3@MindView.net?Subject=[TIJ3]Intro_48" title="Send BackTalk Comment">Feedback</a></font><br></p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -