亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? appendc.htm

?? Thinking in Java, 2nd edition
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
has enough information to deal with them. Do what you can with the exception at
the current level; if that doesn’t solve the problem, rethrow the
exception.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I51' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I52>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>Watch
for long method definitions</B>. Methods should be brief, functional units that
describe and implement a discrete part of a class interface. A method that is
long and complicated is difficult and expensive to maintain, and is probably
trying to do too much all by itself. If you see such a method, it indicates
that, at the least, it should be broken up into multiple methods. It may also
suggest the creation of a new class. Small methods will also foster reuse within
your class. (Sometimes methods must be large, but they should still do just one
thing.)

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I52' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I53>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>Keep
things as &#8220;<I>private</I> as possible.&#8221;</B> Once you publicize an
aspect of your library (a method, a class, a field), you can never take it out.
If you do, you&#8217;ll wreck somebody&#8217;s existing code, forcing them to
rewrite and redesign. If you publicize only what you must, you can change
everything else with impunity, and since designs tend to evolve this is an
important freedom. In this way, implementation changes will have minimal impact
on derived classes. Privacy is especially important when dealing with
multithreading&#8212;only <B>private</B> fields can be protected against
un-<B>synchronized</B> use.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I53' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I54>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>Use
comments liberally, and use the <I>javadoc</I> comment-documentation syntax to
produce your program documentation</B>. However, the comments should add geniune
meaning to the code; comments that only reiterate what the code is clearly
expressing are annoying. Note that the typical verbose detail of Java class and
method names reduce the need for as many comments.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I54' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I55>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>Avoid
using &#8220;magic numbers&#8221;</B>&#8212;which are numbers hard-wired into
code. These are a nightmare if you need to change them, since you never know if
&#8220;100&#8221; means &#8220;the array size&#8221; or &#8220;something else
entirely.&#8221; Instead, create a constant with a descriptive name and use the
constant identifier throughout your program. This makes the program easier to
understand and much easier to maintain.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I55' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I56>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>When
creating constructors, consider exceptions</B>. In the best case, the
constructor won&#8217;t do anything that throws an exception. In the next-best
scenario, the class will be composed and inherited from robust classes only, so
they will need no cleanup if an exception is thrown. Otherwise, you must clean
up composed classes inside a <B>finally</B> clause. If a constructor must fail,
the appropriate action is to throw an exception, so the caller doesn&#8217;t
continue blindly, thinking that the object was created correctly.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I56' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I57>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>If
your class requires any cleanup when the client programmer is finished with the
object, place the cleanup code in a single, well-defined method</B>&#8212;with a
name like <B>cleanup(&#160;)</B> that clearly suggests its purpose. In addition,
place a <B>boolean</B> flag in the class to indicate whether the object has been
cleaned up so that <B>finalize(&#160;)</B> can check for &#8220;the death
condition&#8221; (see Chapter 4).

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I57' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I58>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>The
responsibility of <I>finalize(&#160;)</I> can only be to verify &#8220;the death
condition&#8221; of an object for debugging.</B> (See Chapter 4.) In special
cases, it might be needed to release memory that would not otherwise be released
by the garbage collector. Since the garbage collector might not get called for
your object, you cannot use <B>finalize(&#160;) </B>to perform necessary
cleanup. For that you must create your own &#8220;cleanup&#8221; method. In the
<B>finalize(&#160;)</B> method for the class, check to make sure that the object
has been cleaned up and throw a class derived from <B>RuntimeException</B> if it
hasn&#8217;t, to indicate a programming error. Before relying on such a scheme,
ensure that <B>finalize(&#160;) </B>works on your system. (You might need to
call <B>System.gc(&#160;)</B> to ensure this behavior.)

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I58' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I59>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>If
an object must be cleaned up (other than by garbage collection) within a
particular scope, use the following approach:</B> Initialize the object and, if
successful, immediately enter a <B>try</B> block with a <B>finally</B> clause
that performs the cleanup.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I59' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I60>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>When
overriding <I>finalize(&#160;)</I> during inheritance, remember to call
<I>super.finalize(&#160;)</I>.</B> (This is not necessary if <B>Object</B> is
your immediate superclass.) You should call <B>super.finalize(&#160;)</B> as the
<I>final</I> act of your overridden <B>finalize(&#160;)</B> rather than the
first, to ensure that base-class components are still valid if you need them.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I60' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I61>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>When
you are creating a fixed-size container of objects, transfer them to an
array</B>&#8212;especially if you&#8217;re returning this container from a
method. This way you get the benefit of the array&#8217;s compile-time type
checking, and the recipient of the array might not need to cast the objects in
the array in order to use them. Note that the base-class of the containers
library, <B>java.util.Collection</B>, has two <B>toArray(&#160;)</B> methods to
accomplish this.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I61' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I62>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>Choose
<I>interfaces</I> over <I>abstract</I> classes</B>. If you know something is
going to be a base class, your first choice should be to make it an
<B>interface</B>, and only if you&#8217;re forced to have method definitions or
member variables should you change it to an <B>abstract</B> class. An
<B>interface </B>talks about what the client wants to do, while a class tends to
focus on (or allow) implementation details.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I62' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I63>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>Inside
constructors, do only what is necessary to set the object into the proper
state</B>. Actively avoid calling other methods (except for <B>final</B>
methods) since those methods can be overridden by someone else to produce
unexpected results during construction. (See Chapter 7 for details.) Smaller,
simpler constructors are less likely to throw exceptions or cause problems.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I63' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I64>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>To
avoid a highly frustrating experience, make sure that there is only one
unpackaged class of each name anywhere in your classpath</B>. Otherwise, the
compiler can find the identically-named other class first, and report error
messages that make no sense. If you suspect that you are having a classpath
problem, try looking for <B>.class</B> files with the same names at each of the
starting points in your classpath. Ideally, put all your classes within
packages.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I64' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I65>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>Watch
out for accidental overloading</B>. If you attempt to override a base-class
method and you don&#8217;t quite get the spelling right, you&#8217;ll end up
adding a new method rather than overriding an existing method. However, this is
perfectly legal, so you won&#8217;t get any error message from the compiler or
run-time system&#8212;your code simply won&#8217;t work correctly.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I65' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I66>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>Watch
out for premature optimization</B>. First make it work, then make it
fast&#8212;but only if you must, and only if it&#8217;s proven that there is a
performance bottleneck in a particular section of your code. Unless you have
used a profiler to discover a bottleneck, you will probably be wasting your
time. The hidden cost of performance tweaks is that your code becomes less
understandable and maintainable. 

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I66' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

<backtalk:display ID=TIJ3_APPENDIXC_I67>
</FONT><LI><FONT FACE="Verdana"><B>	</B></FONT><FONT FACE="Georgia"><B>Remember
that code is read much more than it is written</B>. Clean designs make for
easy-to-understand programs, but comments, detailed explanations, and examples
are invaluable. They will help both you and everyone who comes after you. If
nothing else, the frustration of trying to ferret out useful information from
the online Java documentation should convince you.

</backtalk:display>
[&nbsp;<a href='http://www.mindview.net/backtalk/CommentServlet?ID=TIJ3_APPENDIXC_I67' 
  target="_blank">Add&nbsp;Comment</a>&nbsp;]

</FONT></OL>
<HR><DIV ALIGN="LEFT"><P><A NAME="fn85" HREF="#fnB85">[85]</A><FONT FACE="Georgia" SIZE=2>
Explained to me by Andrew Koenig.</FONT><BR></P></DIV>

<DIV ALIGN="CENTER">
    <FONT FACE="Verdana" size = "-1">
     [ <a href="AppendB.htm">Previous Chapter</a> ] 
    [ <a href="SimpCont.htm">Short TOC</a> ] 
    [ <a href="Contents.htm">Table of Contents</a> ] 
    [ <a href="DocIdx.htm">Index</a> ]
     [ <a href="AppendD.htm">Next Chapter</a> ] 
    </FONT>
    <BR>
 Last Update:05/21/2001</P></DIV>

</BODY>

</HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一卡2卡三卡4卡5免费| 欧美亚洲动漫另类| 色八戒一区二区三区| 91精品国产综合久久久久久久久久| 久久综合久久久久88| 亚洲一级片在线观看| 国产一区不卡视频| 欧美日韩国产另类一区| 国产欧美日本一区二区三区| 图片区日韩欧美亚洲| 北条麻妃国产九九精品视频| 欧美成人精品福利| 亚洲成人av一区| 97久久超碰国产精品电影| 欧美福利视频一区| 亚洲综合在线电影| 成人黄色777网| 久久免费视频色| 狠狠色综合日日| 欧美一区二区三区啪啪| 亚洲精品高清视频在线观看| 麻豆精品新av中文字幕| 欧美一区二区三区不卡| 亚洲黄色在线视频| 不卡视频免费播放| 国产精品你懂的在线欣赏| 色视频一区二区| 亚洲素人一区二区| 成人av在线播放网站| 亚洲精品一区二区三区影院| 三级在线观看一区二区| 欧美挠脚心视频网站| 亚洲一区二区三区美女| 一本在线高清不卡dvd| 最新高清无码专区| 久久99精品国产.久久久久久 | 欧美精品日韩一区| 一区二区三区在线免费播放| 色综合久久久久综合体桃花网| 国产精品乱人伦| 91原创在线视频| 亚洲欧洲成人av每日更新| 波多野结衣中文字幕一区二区三区| 中文字幕 久热精品 视频在线| 国产成人午夜精品影院观看视频 | 国产成人自拍网| 欧美精品一区二区三区很污很色的| 老司机精品视频在线| 亚洲精品一区二区三区四区高清| 国产综合久久久久久鬼色| 国产精品私人自拍| 色综合久久天天| 肉色丝袜一区二区| 精品福利在线导航| 粉嫩av一区二区三区粉嫩| 中文字幕日韩一区| 欧美日韩在线精品一区二区三区激情| 青娱乐精品视频| 久久精品欧美一区二区三区不卡 | 亚洲午夜久久久久久久久电影网| 精品视频1区2区| 蜜桃久久久久久久| 国产精品妹子av| 欧美伦理视频网站| 国产91精品免费| 亚洲一区二区欧美激情| 欧美mv日韩mv亚洲| 99在线精品免费| 99在线精品一区二区三区| 一区二区三区加勒比av| 欧美电视剧在线观看完整版| 成人深夜福利app| 日韩成人免费电影| 国产精品第一页第二页第三页| 欧美日韩午夜在线| 国产盗摄一区二区三区| 亚洲电影一级片| 日本一区二区动态图| 欧美一区二视频| 色综合久久天天| 国产在线看一区| 亚洲va天堂va国产va久| 国产日韩欧美高清| 日韩精品一区二区在线观看| 色综合网站在线| 国产乱子伦一区二区三区国色天香| 亚洲综合在线视频| 中文字幕成人av| 日韩三级免费观看| 色播五月激情综合网| 成人免费视频免费观看| 麻豆国产精品一区二区三区| 亚洲精品视频免费看| 国产女同互慰高潮91漫画| 7777精品伊人久久久大香线蕉最新版| 99re66热这里只有精品3直播 | 日韩高清中文字幕一区| 亚洲美女一区二区三区| 欧美极品少妇xxxxⅹ高跟鞋| 91精品国产综合久久精品性色| 91色porny| 成人性生交大片免费看中文| 国产在线看一区| 久久精品国产免费看久久精品| 性欧美大战久久久久久久久| 亚洲欧美另类小说视频| 国产精品青草综合久久久久99| 日韩欧美亚洲一区二区| 欧美精品黑人性xxxx| 欧美中文字幕不卡| 欧美视频一区二区三区在线观看| 99久久精品国产观看| 成人黄色777网| 成人av网站在线观看免费| 国产.精品.日韩.另类.中文.在线.播放| 免费观看在线综合| 久久97超碰色| 国产在线视频一区二区三区| 国产一区二区三区免费| 久久精品国产亚洲a| 欧美疯狂性受xxxxx喷水图片| 欧美色综合网站| 欧美色精品在线视频| 欧美人与z0zoxxxx视频| 91麻豆精品国产91| 日韩一区二区在线看| 久久综合av免费| 国产欧美日韩综合| 久久精品夜色噜噜亚洲a∨| 久久精品一二三| 国产欧美一区视频| 综合亚洲深深色噜噜狠狠网站| 亚洲素人一区二区| 亚洲激情在线播放| 一区二区三区成人在线视频| 丝袜美腿高跟呻吟高潮一区| 免费成人在线视频观看| 国产毛片精品国产一区二区三区| 国产成人精品免费在线| 色综合视频一区二区三区高清| 欧美日韩国产在线播放网站| 国产91在线|亚洲| 91一区二区三区在线观看| 国产盗摄精品一区二区三区在线 | 精品国产乱码久久久久久老虎| 成人一区二区三区视频在线观看| 国产成人av电影在线| 日韩欧美国产不卡| 日韩一区二区电影网| 欧美mv日韩mv国产网站app| 综合久久国产九一剧情麻豆| 国产精品三级在线观看| 91黄色激情网站| 日韩一级欧美一级| 日本一区二区三区四区| 亚洲综合色在线| 国产麻豆精品theporn| 99久久伊人精品| 精品日韩欧美在线| 亚洲免费观看视频| 久久99国内精品| 欧美日韩一区小说| 中文字幕av资源一区| 天天综合天天综合色| 国产v综合v亚洲欧| 91精品国产一区二区三区香蕉| 中文字幕欧美日韩一区| 捆绑调教美女网站视频一区| 99精品视频一区二区三区| 欧美一区二区三区四区在线观看| 亚洲少妇30p| 国产不卡在线视频| 日韩女优av电影| 午夜精品福利视频网站| 成人精品视频一区二区三区尤物| 日韩免费高清视频| 亚洲午夜久久久久| 91色porny在线视频| 日本一区二区三区在线不卡| 美脚の诱脚舐め脚责91| 欧美视频在线不卡| 中文字幕一区二区三区不卡在线| 极品美女销魂一区二区三区免费| 欧美日韩dvd在线观看| 一区二区三区在线观看网站| 成人看片黄a免费看在线| 国产亚洲一区字幕| 国产精品1区2区| 精品乱人伦一区二区三区| 日韩av一级片| 91.xcao| 亚洲伦在线观看| 99久久亚洲一区二区三区青草| 中文字幕免费观看一区| 国产精品18久久久久久久久久久久| 69成人精品免费视频| 亚洲一区中文日韩| 色乱码一区二区三区88| 亚洲欧洲一区二区在线播放| 不卡一二三区首页|