﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-葫芦里卖药-随笔分类-Java</title><link>http://www.blogjava.net/livahu/category/14561.html</link><description>livahu的博客?做一个不浮躁的人=&amp;成功的秘密在于始终唯一的目标=</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 11:54:32 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 11:54:32 GMT</pubDate><ttl>60</ttl><item><title>菜鸟谈流</title><link>http://www.blogjava.net/livahu/archive/2006/10/14/75166.html</link><dc:creator>livahu</dc:creator><author>livahu</author><pubDate>Sat, 14 Oct 2006 10:22:00 GMT</pubDate><guid>http://www.blogjava.net/livahu/archive/2006/10/14/75166.html</guid><wfw:comment>http://www.blogjava.net/livahu/comments/75166.html</wfw:comment><comments>http://www.blogjava.net/livahu/archive/2006/10/14/75166.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/livahu/comments/commentRss/75166.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/livahu/services/trackbacks/75166.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 关于流																		我一直对流都有点晕晕的，今天基本算搞清楚了所以然，所以在这里写出，一来为了记忆，一来也希望能对和我一样在这里有点模糊的一点帮助。（呵呵，不会就我一个人这么倒霉吧？） 												输入流：此流对应于键盘输入或者由主机环境或用户指定的另一个输入源								超类：				InputStream (...&nbsp;&nbsp;<a href='http://www.blogjava.net/livahu/archive/2006/10/14/75166.html'>阅读全文</a><img src ="http://www.blogjava.net/livahu/aggbug/75166.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/livahu/" target="_blank">livahu</a> 2006-10-14 18:22 <a href="http://www.blogjava.net/livahu/archive/2006/10/14/75166.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java的30个学习目标</title><link>http://www.blogjava.net/livahu/archive/2006/10/12/74782.html</link><dc:creator>livahu</dc:creator><author>livahu</author><pubDate>Thu, 12 Oct 2006 06:31:00 GMT</pubDate><guid>http://www.blogjava.net/livahu/archive/2006/10/12/74782.html</guid><wfw:comment>http://www.blogjava.net/livahu/comments/74782.html</wfw:comment><comments>http://www.blogjava.net/livahu/archive/2006/10/12/74782.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/livahu/comments/commentRss/74782.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/livahu/services/trackbacks/74782.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: java的30个学习目标&nbsp;&nbsp;<a href='http://www.blogjava.net/livahu/archive/2006/10/12/74782.html'>阅读全文</a><img src ="http://www.blogjava.net/livahu/aggbug/74782.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/livahu/" target="_blank">livahu</a> 2006-10-12 14:31 <a href="http://www.blogjava.net/livahu/archive/2006/10/12/74782.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>HanioTower</title><link>http://www.blogjava.net/livahu/archive/2006/10/12/74694.html</link><dc:creator>livahu</dc:creator><author>livahu</author><pubDate>Wed, 11 Oct 2006 23:35:00 GMT</pubDate><guid>http://www.blogjava.net/livahu/archive/2006/10/12/74694.html</guid><wfw:comment>http://www.blogjava.net/livahu/comments/74694.html</wfw:comment><comments>http://www.blogjava.net/livahu/archive/2006/10/12/74694.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/livahu/comments/commentRss/74694.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/livahu/services/trackbacks/74694.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: HanioTower&nbsp;&nbsp;<a href='http://www.blogjava.net/livahu/archive/2006/10/12/74694.html'>阅读全文</a><img src ="http://www.blogjava.net/livahu/aggbug/74694.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/livahu/" target="_blank">livahu</a> 2006-10-12 07:35 <a href="http://www.blogjava.net/livahu/archive/2006/10/12/74694.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JVM装载过程简介</title><link>http://www.blogjava.net/livahu/archive/2006/09/06/67976.html</link><dc:creator>livahu</dc:creator><author>livahu</author><pubDate>Wed, 06 Sep 2006 03:08:00 GMT</pubDate><guid>http://www.blogjava.net/livahu/archive/2006/09/06/67976.html</guid><wfw:comment>http://www.blogjava.net/livahu/comments/67976.html</wfw:comment><comments>http://www.blogjava.net/livahu/archive/2006/09/06/67976.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/livahu/comments/commentRss/67976.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/livahu/services/trackbacks/67976.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: ClassLoader												是												Java												虚拟机												(JVM)												的类装载子系统，它负责将												Java												字节码装载到												JVM												中，												并使其成为		...&nbsp;&nbsp;<a href='http://www.blogjava.net/livahu/archive/2006/09/06/67976.html'>阅读全文</a><img src ="http://www.blogjava.net/livahu/aggbug/67976.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/livahu/" target="_blank">livahu</a> 2006-09-06 11:08 <a href="http://www.blogjava.net/livahu/archive/2006/09/06/67976.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Core Java seven edition modify</title><link>http://www.blogjava.net/livahu/archive/2006/09/01/67061.html</link><dc:creator>livahu</dc:creator><author>livahu</author><pubDate>Fri, 01 Sep 2006 04:39:00 GMT</pubDate><guid>http://www.blogjava.net/livahu/archive/2006/09/01/67061.html</guid><wfw:comment>http://www.blogjava.net/livahu/comments/67061.html</wfw:comment><comments>http://www.blogjava.net/livahu/archive/2006/09/01/67061.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/livahu/comments/commentRss/67061.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/livahu/services/trackbacks/67061.html</trackback:ping><description><![CDATA[
		<h3>Seventh Edition Volume 1 <span style="FONT-WEIGHT: bold"></span>(JDK 5.0)<span style="FONT-WEIGHT: bold"></span><a name="CJ7V1"></a><img style="WIDTH: 189px; HEIGHT: 250px" alt="" src="http://www.horstmann.com/corejava/cj7v1.jpg" /></h3>
		<dl>
				<dt>[2] Page xvi 
</dt>
				<dd>In the seventh line from the bottom, change "bugs fixes" to "bug fixes".<br /></dd>
				<dt>[6] Page 18 
</dt>
				<dd>Change "You can download them from <tt>http://www.phptr.com/corejava</tt>." to "You can download them from <tt>http://<b>horstmann</b>.com/corejava</tt>." 
</dd>
				<dt>[4] Page 25 
</dt>
				<dd>In the NOTE, change "Environnment" to "Environment".<br /></dd>
				<dt>[6] Page 36 
</dt>
				<dd>Change “it simply displays the string <tt>We will not use 'Hello, World'!</tt>” to “it simply displays the string <tt>We will not use 'Hello, World!'</tt>” (i.e. move the ! inside the quotes to match the program at the top of the page) 
</dd>
				<dt>[5] Page 40 
</dt>
				<dd>After "..you use a <tt>p</tt>, not an <tt>e</tt>, to denote the exponent." add: "The exponent is specified in decimal and denotes a power of two." 
</dd>
				<dt>[4] Page 41 
</dt>
				<dd>Change "an unused 2048 byte-range" to "a range of 2048 unused values"<br /></dd>
				<dt>[6] Page 56 
</dt>
				<dd>Change "Point your web browser to the <tt>docs/api/index.html</tt> subdirectory of your JDK installation." to "Point your web browser to the <tt>index.html</tt> file in the <tt>docs/api</tt> subdirectory of your JDK installation." 
</dd>
				<dt>[6] Page 62, 123, 125, 465, 629, 630, 631, 640, 641, 642, 649, 681, 
</dt>
				<dd>Change "Boolean" to "<tt>boolean</tt>" (in monospace) 
</dd>
				<dt>[5] Page 62 
</dt>
				<dd>Remove the line "<tt>^</tt> Converts to upper case <tt>0XCAFE</tt>". (This option was present in the Java 5 release candidate, but it was later dropped.) 
</dd>
				<dt>[6] Page 63 
</dt>
				<dd>Change "You use two a two-letter format..." to "You use a two-letter format..." 
</dd>
				<dt>[4] Page 64 
</dt>
				<dd>Last line of Table 3-7 (continued): Change <span style="FONT-FAMILY: monospace">E</span> to <span style="FONT-FAMILY: monospace">Q</span>.<br /></dd>
				<dt>[2] Page 80 BigIntegerTest.java line 8 
</dt>
				<dd>Change <span style="FONT-FAMILY: monospace">Scanner.create</span> to <span style="FONT-FAMILY: monospace">new Scanner</span></dd>
				<dt>[4] Page 85 
</dt>
				<dd>Change <tt>System.out.print(" " + a[i]);</tt> to <tt>System.out.print(" " + a<b>rgs</b>[i]);</tt></dd>
				<dt>[4] Page 86 
</dt>
				<dd>Change "Initially that is just <tt>r</tt> itself, but ..." to "Initially that is just <tt>r + 1</tt>, but..."<br /></dd>
				<dt>[4] Page 89 CompoundInterest.java line 5 
</dt>
				<dd>Change <span style="FONT-FAMILY: monospace">final int STARTRATE</span> to <span style="FONT-FAMILY: monospace">final <span style="FONT-WEIGHT: bold">double</span> STARTRATE</span><br /></dd>
				<dt>[6] Page 95 
</dt>
				<dd>Change "Encapsulation (sometimes called data hiding) is a key concept in working with objects. Formally, encapsulation is nothing more than combining data and behavior in one package and hiding the implementation of the data from the user of the object." to "Encapsulation (sometimes called <b>information</b> hiding) is a key concept in working with objects. Formally, encapsulation is nothing more than combining data and behavior in one package and hiding the implementation <b>details</b> from the user of the object." 
</dd>
				<dt>[4] Page 95 
</dt>
				<dd>Change "When you invoke a message on an object" to "When you invoke a <b>method</b> on an object"<br /></dd>
				<dt>[6] Page 96 
</dt>
				<dd>Change "Thus, a class depends on another class if its methods manipulate objects of that class." to "Thus, a class depends on another class if its methods <b>use or</b> manipulate objects of that class." 
</dd>
				<dt>[4] Page 104-106 CalendarTest.java 
</dt>
				<dd>The program prints an unsatisfactory calendar in locales whose first day of the week is not Sunday. (In most parts of the world, the first day of the week is considered Monday--after all, Saturday and Sunday are the week<span style="FONT-STYLE: italic">end</span>.) The following changes take care of this:<br /><ul><li>Remove the header <span style="FONT-FAMILY: monospace">Sun</span><tt><span>Mon Tue Wed Thu Fri Sat</span></tt> on page 104 
</li><li>In the program listing, replace lines 18 and 19 with<br /><pre> // get first day of week (Sunday in the U.S.)<br /> int firstDayOfWeek = d.getFirstDayOfWeek();</pre></li><li>In lines 22 and 49, replace <span style="FONT-FAMILY: monospace">Calendar.SUNDAY</span> with <span style="FONT-FAMILY: monospace">firstDayOfWeek</span></li><li>Add the following four lines before the <span style="FONT-FAMILY: monospace">}</span> in line 44. (The first line is blank)<br /><pre><br /> // start a new line at the start of the week<br /> if (weekday == firstDayOfWeek)<br /> System.out.println();<br /></pre></li><li>Remove lines 36 through 39 </li></ul></dd>
				<dt>[4] Page 105 
</dt>
				<dd>Change "For each day, we print a space if the day is &lt; 10, then the day, and then a <tt>*</tt> if the day equals the current day." to "The current day is marked with a <tt>*</tt>."<br /></dd>
				<dt>[6] Page 106 
</dt>
				<dd>In the Note, remove "and the hard-wired assumption that the week starts on a Sunday" 
</dd>
				<dt>[6] Page 121 
</dt>
				<dd>Change "demonstate" to "demonstrate" 
</dd>
				<dt>[6] Page 128, 129 
</dt>
				<dd>Change "Booleans" to "<tt>boolean</tt> values" (note monospace) 
</dd>
				<dt>[6] Page 135 
</dt>
				<dd>Remove the sentence "The sole purpose of package nesting is to manage unique names." 
</dd>
				<dt>[6] Page 141 
</dt>
				<dd>Change "Recall that you can import public classes only from other packages." to "Recall that you can import only public classes from other packages." 
</dd>
				<dt>[4] Page 141 
</dt>
				<dd>In the third line from the bottom, change "packages" to "package".<br /></dd>
				<dt>[4] Page 143 
</dt>
				<dd>In the last line, change "set the warning border" to "set the warning string".<br /></dd>
				<dt>[6] Page 147 
</dt>
				<dd>Change "If you like, you can place hyperlinks to other classes or methods anywhere in any of your comments." to "If you like, you can place hyperlinks to other classes or methods anywhere in any of your <tt>javadoc</tt> comments." 
</dd>
				<dt>[6] Page 156 
</dt>
				<dd>Remove "(that is, when i is 1 or 2)" and "(when i is 0)" , so that the remaining clause is "either <tt>Employee</tt> or <tt>Manager</tt>". 
</dd>
				<dt>[6] Page 165 
</dt>
				<dd>Change "In particular, move common fields and methods (whether abstract or not) to the abstract superclass." to "Move common fields and methods (whether abstract or not) to the superclass (whether abstract or not)." 
</dd>
				<dt>[6] Page 172 
</dt>
				<dd>In the numbered list, add 3. before "Compare the classes of <tt>this</tt> and <tt>otherObject</tt>." Increment the following numbers. 
</dd>
				<dt>[4] Page 172 
</dt>
				<dd>Remove "Judging from this evidence. . ." until the end of the note.<br /></dd>
				<dt>[4] Page 173 
</dt>
				<dd>In Table 5-1, change the Hash Code column from 140207504 / 140013338 / 884756206 to 69609650 / 69496448 / -2141031506 
</dd>
				<dt>[4] Page 174 
</dt>
				<dd>In Table 5-2, change 3030 to 2556 (2x)<br /></dd>
				<dt>[6] Page 179 
</dt>
				<dd>Change the last word on the page from "classed" to "called" 
</dd>
				<dt>[6] Page 180/181 
</dt>
				<dd>Change "relocation/tions/ting" to "re<b>a</b>llocation/tions/ting" (3x) 
</dd>
				<dt>[6] Page 181 
</dt>
				<dd>Change "(This is different from, and, of course, never larger than, the array list’s capacity.)" to "(This is of course never larger than the array list’s capacity.)" 
</dd>
				<dt>[6] Page 188 
</dt>
				<dd>Change "returns a new <tt>Integer</tt> object initialized to the integer’s value, assuming the specified <tt>String</tt> represents" to "returns a new <tt>Integer</tt> object initialized to the integer whose digits are contained in the string <tt>s</tt>. The string must represent" (2x) 
</dd>
				<dt>[4] Page 189 
</dt>
				<dd>Change<br /><pre>System.out.printf("%d %d", new Object[] { new Integer(d), "widgets" } );<br /></pre>to<br /><pre>System.out.printf("%d %<b>s</b>", new Object[] { new Integer(<b>n</b>), "widgets" } );</pre></dd>
				<dt>[6] Page 191 
</dt>
				<dd>Remove "We discuss reflection in the next section." 
</dd>
				<dt>[6] Page 198 
</dt>
				<dd>Change the last line from <pre>while (cl != Object.class);</pre>to<pre>while (cl != null);</pre></dd>
				<dt>[6] Page 199 
</dt>
				<dd>Remove line 3 (<tt>import java.text.*;</tt>) 
</dd>
				<dt>[6] Page 201 
</dt>
				<dd>Change "<tt>arrayCopy</tt>" to "<tt>array<b>c</b>opy</tt>" 
</dd>
				<dt>[6] Page 203/204 
</dt>
				<dd>Change "fundamental" to "primitive" (2x) 
</dd>
				<dt>[4] Page 206 
</dt>
				<dd>Change<br /><pre><tt>System.out.printf("%10.4f | %10.4f%n" + y, x, y);</tt></pre>to<tt><br /></tt><pre><tt>System.out.printf("%10.4f | %10.4f%n", x, y);</tt></pre></dd>
				<dt>[4] Page 207 
</dt>
				<dd>Remove code lines 42 and 43.<br /></dd>
				<dt>[4] Page 215 
</dt>
				<dd>Change the first <tt>java.lang.Comparable</tt> API header to <tt>java.lang.Comparable&lt;T&gt;</tt>. Remove the second <tt>java.lang.Comparable&lt;T&gt;</tt> header.<br /></dd>
				<dt>[4] Page 220 and 221<br /></dt>
				<dd>In the <tt>clone</tt> methods, change<br /><pre>return super.clone();<br /></pre>to<br /><pre>return (Employee) super.clone();</pre></dd>
				<dt>Page 221 
</dt>
				<dd>Change <pre>public Object clone() throws CloneNotSupportedException</pre>to<pre>public <b>Employee</b> clone() throws CloneNotSupportedException</pre></dd>
				<dt>[6] Page 228 
</dt>
				<dd>Change “Because the <tt>TalkingClock</tt> defines no constructors” to “Because the <tt>TimePrinter</tt> class defines no constructors” 
</dd>
				<dt>[4] Page 231 
</dt>
				<dd>In the NOTE, change <br /><pre>java ReflectionTest 'TalkingClock$TimePrinter'</pre>to <br /><pre>java ReflectionTest TalkingClock\$TimePrinter<br /></pre>(that is, remove the quotes and add a backslash). Both methods work, but the change matches the preceding text.<br /></dd>
				<dt>[6] Page 233 
</dt>
				<dd>Change “Note that the <tt>TimePrinter</tt> class no longer needs to store a beep instance variable. It simply refers to the parameter variable of the method that contains the class definition.” to “Note that the <tt>TalkingClock</tt> class no longer needs to store a <tt>beep</tt> instance field. The <tt>actionPerformed</tt> method of the <tt>TimePrinter</tt> class simply refers to the <tt>beep</tt> parameter variable of the <tt>start</tt> method.” 
</dd>
				<dt>[4] Page 233 (2x) and 235 (1x)<br /></dt>
				<dd>Change <br /><pre>Timer t = new Timer(1000, listener)<br /></pre>to<br /><pre>Timer t = new Timer(interval, listener)</pre></dd>
				<dt>[4] Page 254 
</dt>
				<dd>Change <tt>/**import java.awt.*</tt> to <tt>import java.awt.*</tt></dd>
				<dt>[6] Page 251 
</dt>
				<dd>Change <tt>frame.show();</tt> to <tt>frame.setVisible(true);</tt></dd>
				<dt>[4] Page 330 
</dt>
				<dd>In the API note for <tt>getActionMap</tt>, change "keystrokes to action keys" to "arbitrary objects to <tt>Action</tt> objects".<br />In the API note for <tt>getInputMap</tt>, change "action keys to action objects" to "keystrokes to arbitrary objects"<br /></dd>
				<dt>[4] Page 330 
</dt>
				<dd>Change <tt>released ctrl Y</tt> to <tt>ctrl released Y</tt><br /></dd>
				<dt>[4] Page 343 
</dt>
				<dd>Change "Each user interface has a wrapper class..." to "Each user interface <b>component</b> has a wrapper class...". 
</dd>
				<dt>[4] Page 349 
</dt>
				<dd>Change "Finally, you add the individual buttons" to "Finally, you add the panel" 
</dd>
				<dt>[4] Page 349 
</dt>
				<dd>The word <tt>add</tt> in "using the <tt>add</tt> method you have seen before" is in the wrong font.<br /></dd>
				<dt>[4] Page 353 
</dt>
				<dd>In the first API note, change <tt>int cols</tt> to <tt>int col<b>umn</b>s</tt><br /></dd>
				<dt>[4] Page 360 
</dt>
				<dd>Remove code lines 66 - 68<br /></dd>
				<dt>[4] Page 400 
</dt>
				<dd>Change the four code lines starting with <br /><pre><tt>JSpinner timeSpinner</tt></pre></dd>
				<dd>to<br /><pre><tt>JSpinner timeSpinner = new JSpinner(new </tt><br />      SpinnerDateModel(new Date(), null, null, Calendar.HOUR)<br />      { <br />         public void setCalendarField(int field) {} <tt><br />      });</tt><br /></pre></dd>
				<dt>[4] Page 402 
</dt>
				<dd>Change code lines 75 - 78 to<br /><tt>      JSpinner timeSpinner = new JSpinner(new <br />            SpinnerDateModel(new Date(), null, null, Calendar.HOUR)<br />            { <br />               public void setCalendarField(int field) {} <br />            });</tt><br /></dd>
				<dt>[4] Page 405 
</dt>
				<dd>In the explanation for the <tt>maximum</tt> parameter of the <tt>javax.swing.SpinnerDateModel</tt> constructor, change "The maximum valid value, or <tt>null</tt> if no lower bound..." to "The maximum valid value, or <tt>null</tt> if no <b>upper</b> bound..." 
</dd>
				<dt>[4] Page 412 
</dt>
				<dd>In the second line from the bottom, change <tt>JPopup</tt> to <tt>JPopupMenu</tt>.<br /></dd>
				<dt>[4] Page 422 
</dt>
				<dd>Below line 28, add a line<br /><pre>add(panel, BorderLayout.CENTER);</pre></dd>
				<dt>[4] Page 432 
</dt>
				<dd>Change <br /><pre>panel.add(style, bold);</pre></dd>
				<dd>to 
</dd>
				<dd>
						<pre>panel.add(component, constraints);<br /></pre>
				</dd>
				<dt>[6] Page 443 
</dt>
				<dd>The bulleted list is wrong (with different errors in two printings). Here is the correct version: 
<ul><li>Connecting the <b>west</b> side of the <b>component</b> with the <b>west</b> side of the <b>container</b>; 
</li><li>Traversing the width of the component; 
</li><li>Connecting the <b>east</b> side of the <b>component</b> with the <b>west</b> side of the <b>container</b>. </li></ul></dd>
				<dt>[4] Page 444 
</dt>
				<dd>Change <br /><pre>Spring.max(layout.getConstraints(faceLabel).getWidth(),<br />Spring.max(layout.getConstraints(sizeLabel).getWidth()));<br /></pre>to<br /><pre>Spring.max(layout.getConstraints(faceLabel).getWidth(),<br />layout.getConstraints(sizeLabel).getWidth()));</pre>(i.e., remove the second <tt>Spring.Max(</tt>)<br /></dd>
				<dt>[4] Page 447 
</dt>
				<dd>Change "...to the given side of the <tt>start</tt> container" to "...to the given side of the <tt>start</tt><b>component</b>" 
</dd>
				<dt>[4] Page 457 
</dt>
				<dd>Change "The icon is a warning icon" to "The icon is a <b>question</b> icon". Change <tt>WARNING_MESSAGE</tt> to <b><tt>QUESTION</tt></b><tt>_MESSAGE</tt><br /></dd>
				<dt>[6] Page 509 
</dt>
				<dd>Change “NOTE: The strings used when you define the parameters with the param tag and those used in the getParameter method must match exactly. In particular, both are case sensitive.” to “NOTE: A case-insensitive comparison is used when matching the <tt>name</tt> attribute value in the <tt>param</tt> tag and the argument of the <tt>getParameter</tt> method.” 
</dd>
				<dt>[6] Page 522, 524 
</dt>
				<dd>Change <pre>public Enumeration getApplets() { return null; } </pre>to <pre>public Enumeration&lt;Applet&gt; getApplets() { return null; } </pre>and <pre>public Iterator getStreamKeys() { return null; }</pre>to <pre>public Iterator&lt;String&gt; getStreamKeys() { return null; }</pre></dd>
				<dt>[6] Page 547 
</dt>
				<dd>Change <pre>defaultSettings.put("color.red", "0 50 50");</pre>to<pre>defaultSettings.put("color.red", "0");</pre></dd>
				<dt>[4] Page 567 
</dt>
				<dd>Change <tt>se.setCause(e)</tt> to <tt>se.<b>init</b>Cause(e)</tt><br /></dd>
				<dt>[4] Page 571 
</dt>
				<dd>Change the numbers after <tt>StackTraceTest.java:</tt> from 8 23 / 8 14 23 / 8 14 14 23 to 17 33 / 17 23 33 / 17 23 23 33<br /></dd>
				<dt>[6] Page 602 
</dt>
				<dd>Change <pre>java -Dcom.sun.management.jmxremote MyProgram.java</pre>to<pre>java -Dcom.sun.management.jmxremote MyProgram</pre></dd>
				<dt>[6] Page 604 
</dt>
				<dd>Change <tt>void addXxxListener(XxxEvent)</tt> to <tt>void addXxxListener(<b>XxxListener</b>)</tt>. 
</dd>
				<dt>[4] Page 615 
</dt>
				<dd>Change "displays all instance fields of the <tt>evt</tt> variable" to "displays all instance fields of the <tt>ev<b>en</b>t</tt> variable" 
</dd>
				<dt>[4] Page 630 
</dt>
				<dd>In the second line of Table 12-2, change b<sub>17</sub>a<sub>16</sub>a<sub>15</sub>... to b<sub>17</sub><b>b</b><sub>16</sub>a<sub>15</sub>... 
</dd>
				<dt>[6] Page 632 
</dt>
				<dd>Change “The advantage of having the RandomAccessFile class implement both DataInput and DataOutput is that this lets you use or write methods whose argument types are the DataInput and DataOutput interfaces.” to “The <tt>RandomAccessFile</tt> class implements both <tt>DataInput</tt> and <tt>DataOutput</tt>. It is a good idea to use these interfaces for method parameters.” 
</dd>
				<dt>[4] Page 634 
</dt>
				<dd>Change <tt>Set&lt;String, CharSet&gt;</tt> to <tt><b>Map</b>&lt;String, CharSet&gt;</tt>. 
</dd>
				<dt>[5] Page 639 
</dt>
				<dd>In the API description for <tt>CharBuffer decode(ByteBuffer buffer)</tt>, change "decodes the given character sequence ..." to "decodes the given <b>byte</b> sequence" 
</dd>
				<dt>[4] Page 658 
</dt>
				<dd>In the second line from the bottom, change <tt>long int nbytes</tt> to <tt>long nbytes</tt>.<br /></dd>
				<dt>[4] Page 660<br /></dt>
				<dd>Lines 76, 77 of the code should be<br /><tt>      Raises the salary of this employee.<br />      @param byPercent the percentage of the raise</tt><br /></dd>
				<dt>[4] Page 667 
</dt>
				<dd>Change "The <tt>java.util.Date</tt> class defines its own <tt>readObject</tt>/<tt>writeObject</tt> methods" to "The serializable <tt>java.util.Date</tt> class defines its own <tt></tt><tt>writeObject</tt> method". (The wording in the book was correct, but it confused some readers into thinking that <tt>Date</tt> is externalizable.)<br /></dd>
				<dt>[4] Page 688 
</dt>
				<dd>In the documentation for <tt>createNewFile</tt>, change "automatically creates" to "<b>atom</b>ically creates". 
</dd>
				<dt>[4] Page 713 
</dt>
				<dd>In the second line of the section <b>Generic Code and the Virtual Machine</b>, change "was even able compile" to "was even able <b>to</b> compile". <br /></dd>
				<dt>[4] Page 719 
</dt>
				<dd>In the third line from the top, change <tt>new Pair&lt;String&gt;(10)</tt> to <tt>new Pair&lt;String&gt;<b>[</b>10<b>]</b></tt></dd>
				<dt>[4] Page 720 
</dt>
				<dd>In the tenth line from the bottom, change <br /></dd>
				<dd>
						<pre>
								<tt>Pair&lt;Employee&gt; = ArrayAlg...</tt>
						</pre>
				</dd>
				<dd>to <br /><pre>Pair&lt;Employee&gt; <b>result</b> = ArrayAlg...</pre></dd>
				<dt>[6] Page 723 
</dt>
				<dd>Change<br /><tt>void set(? super Manager)<br />? super Manager get()<br /></tt>to<br /><tt>void set<b>First</b>(? super Manager)<br />? super Manager get</tt><tt><b>First</b></tt><tt>()</tt></dd>
				<dt>[6] Page 723 
</dt>
				<dd>Change "with any <tt>Manager</tt> object (or a subtype such as <tt>Executive</tt>), but not with an <tt>Employee</tt>" to "with any value of type <tt>Manager</tt>, <tt>Employee</tt>, or <tt>Object</tt>, but not with a subtype value such as <tt>Executive</tt>." 
</dd>
				<dt>[6] Page 726 
</dt>
				<dd>Change “Of course, in this case, we were not compelled to use a wildcard—there is nothing wrong with using a type parameter, as in the <tt>swapHelper</tt> method.” to “Of course, in this case, we were not compelled to use a wildcard. We could have directly implemented <tt>&lt;T&gt; void swap(Pair&lt;T&gt; p)</tt> as a generic method without wildcards.” 
</dd>
				<dt>[4] Page 735 
</dt>
				<dd>Add an entry<br /><table style="WIDTH: 50%; TEXT-ALIGN: left" cellspacing="2" cellpadding="2" border="1"><tbody><tr><td style="VERTICAL-ALIGN: top"><span style="FONT-FAMILY: monospace">enum</span></td><td style="VERTICAL-ALIGN: top">an enumerated type</td><td style="VERTICAL-ALIGN: top">3</td></tr></tbody></table></dd>
				<dt>[6] Page 743 
</dt>
				<dd>Change "<tt>Boolean</tt>, 42, 46, 186, 735" to two entries "<tt>boolean</tt>, 42, 46, 735" and "<tt>Boolean</tt>, 186" 
</dd>
				<dt>[6] Page 760 
</dt>
				<dd>Change "true or false, <i>see</i><tt>Boolean</tt>" to "true or false, <i>see</i><tt>boolean</tt>" </dd>
		</dl>
		<h3>Seventh Edition Volume 2 <span style="FONT-WEIGHT: bold"></span>(JDK 5.0)<span style="FONT-WEIGHT: bold"></span><a name="CJ7V2"></a><br /></h3>
		<dl>
				<dt>[3] Page xvii 
</dt>
				<dd>In the second line from the bottom, change <b>Example 5-8</b> to <b>Example 5-12</b><br /></dd>
				<dt>[4] Page 3 
</dt>
				<dd>Change "inside the <tt>move</tt> method of the <tt>Ball</tt> class." to "inside the <tt>addBall</tt> method of the <tt>BounceFrame</tt> class". 
</dd>
				<dt>Page 12 BounceThread.java 
</dt>
				<dd>Remove these lines:<pre>203. public static final int STEPS = 1000;
204. public static final int DELAY = 3;</pre></dd>
				<dt>[3] Page 19 
</dt>
				<dd>Change "of its parent thread, that is, the thread that started it" to "of the thread that constructed it"<br /></dd>
				<dt>[2] Page 30 
</dt>
				<dd>Change "You must make sure that the thread cannot be interrupted between the test and the insertion." to "You must make sure that <b>no other thread can modify the balance</b> between the test and the <b>transfer action</b>." 
</dd>
				<dt>[2] Page 40 
</dt>
				<dd>Remove the first four lines after <i><b>Synchronized Blocks</b></i> "However, a Java object ... only one condition". <br /></dd>
				<dt>[2] Page 41 
</dt>
				<dd>Apply boldface to <tt>synchronized (lock)</tt> and remove it from <tt>System.out.println(. . .)</tt><br /></dd>
				<dt>[2] Page 42 
</dt>
				<dd>Change $1,200 to $200 and $1,300 to $300 
</dd>
				<dt>[2] Page 43 
</dt>
				<dd>In Figure 1-6, change 1200 to 200 and 1300 to 300<br /></dd>
				<dt>[3] Page 49 
</dt>
				<dd>Change "The call <tt>Object head = q.poll(...)</tt> returns <tt>true</tt> for 100 milliseconds ..." to "The call <tt>Object head = q.poll(...)</tt> tries for 100 milliseconds ..."<br /></dd>
				<dt>[2] Page 64 
</dt>
				<dd>In the code just above the API notes, change <tt>taks.size()</tt> to <tt>tasks.size()</tt>. 
</dd>
				<dt>[4] Page 100 
</dt>
				<dd>In the API notes for the <tt>remove</tt> method of <tt>java.util.List&lt;E&gt;</tt>, change "removes and returns an element at the specified position" to "removes and returns <b>the</b> element at the specified position" 
</dd>
				<dt>[4] Page 100 
</dt>
				<dd>In the API notes for <tt>java.util.List&lt;E&gt;</tt>, add the following before <tt>E set(int i, E element)</tt>: 
<ul><li><tt>E get(int i)</tt><br />returns the element at the specified position. </li></ul></dd>
				<dt>[3] Page 130 Code line 98 
</dt>
				<dd>Change <br /><pre>return offset &lt; elements.length;</pre>to<br /><pre>return offset &lt; count; </pre></dd>
				<dt>[4] Page 152, 153 ThreadedEchoServer.java 
</dt>
				<dd>Remove lines 43, 86. Change the following lines:<pre>22. Runnable r = new ThreadedEchoHandler(incoming);
44. public ThreadedEchoHandler(Socket i)<br />47. incoming = i;</pre></dd>
				<dt>[4] Page 166 
</dt>
				<dd>In the API note of <tt>void setConnectTimeout(int timeout)</tt>/<tt>int getConnectTimeout()</tt>, change "...the <tt>read</tt> method of the associated input stream..." to "...the <b><tt>connect</tt></b> method of the associated input stream...". In the API note of <tt>void setReadTimeout(int timeout)</tt>/<tt>int getReadTimeout()</tt>, change "...the <tt>connect</tt> method of the associated input stream..." to "...the <b><tt>read</tt></b> method of the associated input stream...". 
</dd>
				<dt>Page 175 
</dt>
				<dd>The <tt>Scanner</tt> class wraps the <tt>InterruptedIOException</tt>. For greater clarity, change<br /><tt>Scanner in = new Scanner(s.getInputStream()); String line = in.nextLine();</tt><br />to <br /><tt>InputStream in = s.getInputStream();</tt><tt>// </tt>read from <tt>in<br /></tt></dd>
				<dt>[2] Page 229 
</dt>
				<dd>Change "gets a description of all tables in a catalog..." to "<b>returns</b> a description of all tables in a catalog..." 
</dd>
				<dt>[2] Page 229 
</dt>
				<dd>Change "The <tt>catalog</tt> and <tt>schema</tt> parameters..." to "The <tt>catalog</tt> and <tt>schema<b>Pattern</b></tt> parameters..." 
</dd>
				<dt>[3] Page 240 
</dt>
				<dd>Change<br /><pre>stat.releaseSavepoint(svpt) <br /></pre>to<br /><pre><b>conn</b>.releaseSavepoint(svpt)</pre></dd>
				<dt>[2] Page 244 
</dt>
				<dd>In the last two rectangles in the bottom row of Figure 4-9, change <tt>ou=people</tt> to <tt>ou=<b>groups</b></tt><br /></dd>
				<dt>[4] Page 281 
</dt>
				<dd>
						<tt>Product.java</tt> is the wrong version. The companion code has the correct version, but it is too long to fit in its entirety. Use this abbreviated version:<pre>import java.rmi.*;

public interface Product extends Remote
{ 
   /**
      Gets the description of this product.
      @return the product description
   */
   String getDescription() throws RemoteException;

   final int MALE = 1;
   final int FEMALE = 2;
   final int BOTH = MALE + FEMALE;
}
</pre></dd>
				<dt>[4] Page 282 
</dt>
				<dd>
						<tt>ProductImpl.java</tt> is the wrong version. The companion code has the correct version, but it is too long to fit in its entirety. Use this abbreviated version:<pre>import java.rmi.*;
import java.rmi.server.*;

public class ProductImpl extends UnicastRemoteObject implements Product
{ 
   public ProductImpl(String n, int s, int age1, int age2, String h) throws RemoteException
   {  
      name = n;
      ageLow = age1;
      ageHigh = age2;
      sex = s;
      hobby = h;
   }

   public boolean match(Customer c)
   {  
      if (c.getAge() &lt; ageLow || c.getAge() &gt; ageHigh)
         return false;
      if (!c.hasHobby(hobby)) return false;
      if ((sex &amp; c.getSex()) == 0) return false;
      return true;
   }

   public String getDescription() throws RemoteException
   {  
      return "I am a " + name + ". Buy me!";
   }

   private String name, hobby;
   private int ageLow, ageHigh, sex;
}
</pre></dd>
				<dt>[3] Page 293 
</dt>
				<dd>Change<br /><pre>name = (String) data.get();; <br /></pre>to<br /><pre>name = (String) data.get();</pre></dd>
				<dt>[4] Page 294, 295 
</dt>
				<dd>
						<tt>ProductImpl.java</tt> is the wrong version. The companion code has the correct version, but it is too long to fit in its entirety. Use this abbreviated version:<pre>import java.io.*;
import java.rmi.*;
import java.rmi.activation.*;

public class ProductImpl
   extends Activatable
   implements Product
{ 
   /**
      Constructs a product implementation
      @param id the activation id
      @param data the marshalled construction parameter (containing the product name)
   */
   public ProductImpl(ActivationID id, MarshalledObject data) 
      throws RemoteException, IOException, ClassNotFoundException
   {  
      super(id, 0);
      name = (String) data.get();
      System.out.println("Constructed " + name);
   }

   public String getDescription() throws RemoteException
   {  
      return "I am a " + name + ". Buy me!";
   }

   private String name;
}
</pre></dd>
				<dt>[4] Page 296 
</dt>
				<dd>Change <pre>static Remote register(ActivationDescriptor desc)</pre>to <pre>static Remote register(<b>ActivationDesc</b> desc)</pre></dd>
				<dt>[4] Page 311 
</dt>
				<dd>Change <pre>System.out.println(orb.object_to_string(impl));</pre>to<pre>System.out.println(orb.object_to_string(<b>ref</b>));</pre></dd>
				<dt>[2] Page 334 
</dt>
				<dd>Remove the line <br /><pre>JLabel label = new JLabel();</pre></dd>
				<dt>[4] Page 391 
</dt>
				<dd>Add <tt>return this;</tt> as the last line of <tt>getTableCellRendererComponent</tt> so that the code looks like this:<pre>class ColorTableCellRenderer extends JPanel implements TableCellRenderer
{
   public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
      boolean hasFocus, int row, int column)
   {
      setBackground((Color) value);
      if (hasFocus)
         setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
      else
         setBorder(null);
      <b>return this;</b>
   }
}</pre></dd>
				<dt>[2] Page 425 
</dt>
				<dd>Change "on the CD" to "in the companion code" 
</dd>
				<dt>[3] Page 439 
</dt>
				<dd>In Fig. 6-48, change the callout "minimize icon" to "maximize icon"<br /></dd>
				<dt>[4] Page 443 
</dt>
				<dd>Change “The <tt>JDesktopPane</tt> class has no method to return the selected frame. Instead, you must traverse all frames ...” to “Traverse all frames ...”. (Actually, you can get the selected frame by calling <tt>JDesktopPane.getSelectedFrame</tt>, but we need its <i>index</i>.) 
</dd>
				<dt>[4] Page 462 
</dt>
				<dd>Change "... drawn by the <tt>CubicCurve3D</tt> class ..." to "... drawn by the <tt>CubicCurve<b>2D</b></tt> class ..." 
</dd>
				<dt>[3] Page 462 
</dt>
				<dd>Change "between 2180 and 180" to "between -180 and 180"<br /></dd>
				<dt>[3] Page 664 
</dt>
				<dd>Example 8-10: ChartBean2BeanInfo.java has the wrong file. The correct file is<br /><pre>package com.horstmann.corejava;<br /><br />import java.awt.*;<br />import java.beans.*;<br /><br />/**<br /> The bean info for the chart bean, specifying the <br /> icons and the customizer.<br />*/<br />public class ChartBean2BeanInfo extends SimpleBeanInfo<br />{ <br /> public BeanDescriptor getBeanDescriptor()<br /> { <br /> return new BeanDescriptor(ChartBean2.class, ChartBean2Customizer.class);<br /> }<br /><br /> public Image getIcon(int iconType)<br /> { <br /> String name = "";<br /> if (iconType == BeanInfo.ICON_COLOR_16x16) name = "COLOR_16x16";<br /> else if (iconType == BeanInfo.ICON_COLOR_32x32) name = "COLOR_32x32";<br /> else if (iconType == BeanInfo.ICON_MONO_16x16) name = "MONO_16x16";<br /> else if (iconType == BeanInfo.ICON_MONO_32x32) name = "MONO_32x32";<br /> else return null;<br /> return loadImage("ChartBean2_" + name + ".gif");<br /> }<br />}<br /><br /></pre></dd>
				<dt>[4] Page 705 
</dt>
				<dd>Change http://bugs.sun.com/developer/bugParade/bugs/4030988.html to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4030988 
</dd>
				<dt>[4] Page 772 
</dt>
				<dd>Change<pre>int outputSize= cipher.getOutputSize(inLength);</pre>to<pre>int outputSize= cipher.getOutputSize(<b>blockSize</b>);</pre></dd>
				<dt>[3] Page 788 
</dt>
				<dd>In the fourth line from the bottom, change "the <tt>java.text</tt> class" to "the <tt>java.text</tt><b>package</b>" 
</dd>
				<dt>[3] Page 807 
</dt>
				<dd>In the 4th line from the bottom (excluding the CAUTION note), change <tt>10.0E7</tt> to <tt>10.0E<b>8</b></tt>.<br /></dd>
				<dt>[4] Page 811 
</dt>
				<dd>Change <tt>java -encoding Big5 Myfile.java</tt> to <tt><b>javac</b> -encoding Big5 Myfile.java</tt>. 
</dd>
				<dt>[2] Page 833 
</dt>
				<dd>In line 17 of the code for HelloNative.h, change <tt>ifdef</tt> to <tt>#ifdef</tt></dd>
				<dt>[3] Page 836 
</dt>
				<dd>Change <br />... a format string <tt>"%w.pf"</tt> ...<br />to<br />... a format string <tt>"%</tt><i>w</i><tt>.</tt><i>p</i><tt>f"</tt> ...<br />(<i>w</i> and <i>p</i> should be Roman italic)<br /></dd>
				<dt>[2] Page 861 
</dt>
				<dd>Change<br /><pre>jint ThrowNew(JNIEnv *env, jclass clazz, const char msg[])</pre>to<br /><pre>jint ThrowNew(JNIEnv *env, jclass cl, const char msg[])</pre></dd>
				<dt>[3] Page 878 
</dt>
				<dd>Change <tt>GetSuperClass</tt> to <tt>GetSuper<b>c</b>lass</tt></dd>
				<dt>[3] Page 927 
</dt>
				<dd>Change "XML Style Sheet Transformations" to "Extensible Stylesheet Language Transformations"<br /></dd>
				<dt>[4] Page 935 
</dt>
				<dd>In Figure 12-8, change the rightmost “XML Document” to “Transformed Document (HTML, text, ...)” </dd>
		</dl>
		<p> </p>
<img src ="http://www.blogjava.net/livahu/aggbug/67061.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/livahu/" target="_blank">livahu</a> 2006-09-01 12:39 <a href="http://www.blogjava.net/livahu/archive/2006/09/01/67061.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用netbeans5.5有感</title><link>http://www.blogjava.net/livahu/archive/2006/08/30/66632.html</link><dc:creator>livahu</dc:creator><author>livahu</author><pubDate>Wed, 30 Aug 2006 04:08:00 GMT</pubDate><guid>http://www.blogjava.net/livahu/archive/2006/08/30/66632.html</guid><wfw:comment>http://www.blogjava.net/livahu/comments/66632.html</wfw:comment><comments>http://www.blogjava.net/livahu/archive/2006/08/30/66632.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/livahu/comments/commentRss/66632.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/livahu/services/trackbacks/66632.html</trackback:ping><description><![CDATA[
		<p>有了一下netbeans5.5感觉比5.0好多了.从中有些小的体会,写出来与大家分享,同时也希望大家能从中得到一些提示或帮助<br /><br /><font color="#6666ff" size="4"><strong>1.netbeans5.5中文太小,比较丑,可以这个改过来</strong></font><br />======================================<br />对这个文件进行编辑netbeans-5.5beta2\etc\netbeans.conf<br />先删除以前里面的所有内容再复制以下内容<br /># ${HOME} will be replaced by JVM user.home system property<br />netbeans_default_userdir="${HOME}/.netbeans/5.5beta2"</p>
		<p># options used by netbeans launcher by default, can be overridden by explicit<br /># command line switches<br />netbeans_default_options="-J-Xms32m -J-Xmx128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-ea -J-Dapple.laf.useScreenMenuBar=true <font color="#ff3333">--fontsize 13</font>"<br /># --- tips for more advanced options you could use ---<br /># for JDKs where it is supported (for example Sun's JDK 5.0 and newer),<br /># you can use the following set of options which enable Concurrent Mark and<br /># Sweep garbage collection algorithm and improve UI responsiveness<br /># (see FAQ item <a href="http://www.netbeans.org/kb/faqs/performance.html#FaqGCPauses">http://www.netbeans.org/kb/faqs/performance.html#FaqGCPauses</a>)<br />#netbeans_default_options="-J-Xms32m -J-Xmx128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled"<br /># ---</p>
		<p># default location of J2SE JDK, can be overridden by using --jdkhome &lt;dir&gt; switch<br />netbeans_jdkhome="D:\Program Files\Java\jdk1.5.0_08"</p>
		<p># clusters' paths separated by path.separator (semicolon on Windows, colon on Unices)<br />#netbeans_extraclusters="/absolute/path/to/cluster1:/absolute/path/to/cluster2"<br /><br />其中fontsize可以更大,不过本人觉得13够了和netbeans5.0差不多.<br /><br /><strong><font color="#6666ff" size="4">2.netbeans5.5中加快代码提示速度<br /></font></strong>======================================<br />在选项中 高级选项--&gt;&gt;编辑--&gt;&gt;编辑器设置--&gt;&gt;Java编辑器--&gt;完成窗口自动弹出之前的延时时间 将250设置为0<br /><br />高级选项--&gt;&gt;编辑--&gt;&gt;编辑器设置--&gt;&gt;Java编辑器--&gt; 属性栏里面把区分大小写的代码完成前面的小勾去掉(默认没有选上即false状态,如果不小心选上请去掉)<br /><br /><strong><font color="#6666ff" size="4">3.netbeans5.5将NetBeans的项目编译成本地exe文件<br /></font></strong>======================================<br />新建项目-&gt;&gt;NetBeans插件模块-&gt;&gt;模块套件项目<br /><br /><strong><font color="#6666ff" size="4">4.netbeans5.5最好将NetBeans快捷键设为eclipse的模式,本人觉得这样方便eclipse与netbeans共同使用</font></strong><br /></p>
<img src ="http://www.blogjava.net/livahu/aggbug/66632.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/livahu/" target="_blank">livahu</a> 2006-08-30 12:08 <a href="http://www.blogjava.net/livahu/archive/2006/08/30/66632.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于jdk1.5泛型的思考</title><link>http://www.blogjava.net/livahu/archive/2006/08/28/66208.html</link><dc:creator>livahu</dc:creator><author>livahu</author><pubDate>Mon, 28 Aug 2006 08:19:00 GMT</pubDate><guid>http://www.blogjava.net/livahu/archive/2006/08/28/66208.html</guid><wfw:comment>http://www.blogjava.net/livahu/comments/66208.html</wfw:comment><comments>http://www.blogjava.net/livahu/archive/2006/08/28/66208.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/livahu/comments/commentRss/66208.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/livahu/services/trackbacks/66208.html</trackback:ping><description><![CDATA[
		<p>
				<font color="#ff0000" size="4">大家先看看下面这段小程序</font>
		</p>
		<div style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
				<div>
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />
						<span style="COLOR: #0000ff">import</span>
						<span style="COLOR: #000000"> java.util.ArrayList;<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /></span>
						<span style="COLOR: #0000ff">import</span>
						<span style="COLOR: #000000"> java.util.List;<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /><br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /></span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000">申明一个泛型类</span>
						<span style="COLOR: #008000">
								<br />
								<img id="_88_277_Open_Image" onclick="this.style.display='none'; document.getElementById('_88_277_Open_Text').style.display='none'; document.getElementById('_88_277_Closed_Image').style.display='inline'; document.getElementById('_88_277_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" />
								<img id="_88_277_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_88_277_Closed_Text').style.display='none'; document.getElementById('_88_277_Open_Image').style.display='inline'; document.getElementById('_88_277_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" />
						</span>
						<span style="COLOR: #0000ff">public</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">class</span>
						<span style="COLOR: #000000"> GenericClass </span>
						<span id="_88_277_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span>
						<span id="_88_277_Open_Text">
								<span style="COLOR: #000000">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />    <br /><img id="_139_275_Open_Image" onclick="this.style.display='none'; document.getElementById('_139_275_Open_Text').style.display='none'; document.getElementById('_139_275_Closed_Image').style.display='inline'; document.getElementById('_139_275_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" /><img id="_139_275_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_139_275_Closed_Text').style.display='none'; document.getElementById('_139_275_Open_Image').style.display='inline'; document.getElementById('_139_275_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" />    </span>
								<span style="COLOR: #0000ff">public</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">static</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">void</span>
								<span style="COLOR: #000000"> main(String [] args) </span>
								<span id="_139_275_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span>
								<span id="_139_275_Open_Text">
										<span style="COLOR: #000000">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />        List</span>
										<span style="COLOR: #000000">&lt;</span>
										<span style="COLOR: #000000">Integer</span>
										<span style="COLOR: #000000">&gt;</span>
										<span style="COLOR: #000000"> list </span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000"> </span>
										<span style="COLOR: #0000ff">new</span>
										<span style="COLOR: #000000"> ArrayList</span>
										<span style="COLOR: #000000">&lt;</span>
										<span style="COLOR: #000000">Integer</span>
										<span style="COLOR: #000000">&gt;</span>
										<span style="COLOR: #000000">();<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />        list.add(</span>
										<span style="COLOR: #000000">1</span>
										<span style="COLOR: #000000">);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />        list.add(</span>
										<span style="COLOR: #000000">2</span>
										<span style="COLOR: #000000">);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />        </span>
										<span style="COLOR: #0000ff">new</span>
										<span style="COLOR: #000000"> Product().prt(list);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" />    }</span>
								</span>
								<span style="COLOR: #000000">
										<br />
										<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" />}</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />
								<br />
								<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />
						</span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000">制造一个类用于说明问题</span>
						<span style="COLOR: #008000">
								<br />
								<img id="_311_388_Open_Image" onclick="this.style.display='none'; document.getElementById('_311_388_Open_Text').style.display='none'; document.getElementById('_311_388_Closed_Image').style.display='inline'; document.getElementById('_311_388_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" />
								<img id="_311_388_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_311_388_Closed_Text').style.display='none'; document.getElementById('_311_388_Open_Image').style.display='inline'; document.getElementById('_311_388_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" />
						</span>
						<span style="COLOR: #0000ff">class</span>
						<span style="COLOR: #000000"> Product</span>
						<span style="COLOR: #000000"> </span>
						<span id="_311_388_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span>
						<span id="_311_388_Open_Text">
								<span style="COLOR: #000000">{<br /><img id="_349_386_Open_Image" onclick="this.style.display='none'; document.getElementById('_349_386_Open_Text').style.display='none'; document.getElementById('_349_386_Closed_Image').style.display='inline'; document.getElementById('_349_386_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" /><img id="_349_386_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_349_386_Closed_Text').style.display='none'; document.getElementById('_349_386_Open_Image').style.display='inline'; document.getElementById('_349_386_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" />    </span>
								<span style="COLOR: #0000ff">public</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">void</span>
								<span style="COLOR: #000000"> prt(List</span>
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000">String</span>
								<span style="COLOR: #000000">&gt;</span>
								<span style="COLOR: #000000"> lt) </span>
								<span id="_349_386_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span>
								<span id="_349_386_Open_Text">
										<span style="COLOR: #000000">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />        System.out.println(lt);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" />    }</span>
								</span>
								<span style="COLOR: #000000">
										<br />
										<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" />}</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />
								<br />
								<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />
						</span>
				</div>
		</div>
		<p> </p>
		<p>编译器报错,说无法将Product中的prt(java.util.List&lt;java.lang.String&gt;)应用于(java.util.List&lt;java.lang.Integer&gt;)。前面定义了List&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;()；后面却调用 public void prt(List&lt;String&gt; lt)用list做参数，肯定是错误的用法。编译器报错的行为是很正确的，他帮助你避免了潜在错误的发生。这里要注意泛型的作用：List&lt;Integer&gt;和List&lt;String&gt;虽然看着都是List，但编译器把他们当作不同的class，不能相互替代。这是泛型的基本原则。你可以把他们看成一个是Class1， 一个是Class2， 当然不能给一个需要类型为Class1的参数的方法传一个类型为Class2的参数的方法啦。 </p>
		<p>
				<font color="#ff0000" size="4">再来看上面程序稍微改动一处的情况</font>
		</p>
		<div style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
				<div>
						<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />
						<span style="COLOR: #0000ff">import</span>
						<span style="COLOR: #000000"> java.util.ArrayList;<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /></span>
						<span style="COLOR: #0000ff">import</span>
						<span style="COLOR: #000000"> java.util.List;<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /><br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /></span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000">申明一个泛型类</span>
						<span style="COLOR: #008000">
								<br />
								<img id="_88_277_Open_Image" onclick="this.style.display='none'; document.getElementById('_88_277_Open_Text').style.display='none'; document.getElementById('_88_277_Closed_Image').style.display='inline'; document.getElementById('_88_277_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" />
								<img id="_88_277_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_88_277_Closed_Text').style.display='none'; document.getElementById('_88_277_Open_Image').style.display='inline'; document.getElementById('_88_277_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" />
						</span>
						<span style="COLOR: #0000ff">public</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">class</span>
						<span style="COLOR: #000000"> GenericClass </span>
						<span id="_88_277_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span>
						<span id="_88_277_Open_Text">
								<span style="COLOR: #000000">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />    <br /><img id="_139_275_Open_Image" onclick="this.style.display='none'; document.getElementById('_139_275_Open_Text').style.display='none'; document.getElementById('_139_275_Closed_Image').style.display='inline'; document.getElementById('_139_275_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" /><img id="_139_275_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_139_275_Closed_Text').style.display='none'; document.getElementById('_139_275_Open_Image').style.display='inline'; document.getElementById('_139_275_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" />    </span>
								<span style="COLOR: #0000ff">public</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">static</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">void</span>
								<span style="COLOR: #000000"> main(String [] args) </span>
								<span id="_139_275_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span>
								<span id="_139_275_Open_Text">
										<span style="COLOR: #000000">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />        List</span>
										<span style="COLOR: #000000">&lt;</span>
										<span style="COLOR: #000000">Integer</span>
										<span style="COLOR: #000000">&gt;</span>
										<span style="COLOR: #000000"> list </span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000"> </span>
										<span style="COLOR: #0000ff">new</span>
										<span style="COLOR: #000000"> ArrayList</span>
										<span style="COLOR: #000000">&lt;</span>
										<span style="COLOR: #000000">Integer</span>
										<span style="COLOR: #000000">&gt;</span>
										<span style="COLOR: #000000">();<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />        list.add(</span>
										<span style="COLOR: #000000">1</span>
										<span style="COLOR: #000000">);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />        list.add(</span>
										<span style="COLOR: #000000">2</span>
										<span style="COLOR: #000000">);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />        </span>
										<span style="COLOR: #0000ff">new</span>
										<span style="COLOR: #000000"> Product().prt(list);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" />    }</span>
								</span>
								<span style="COLOR: #000000">
										<br />
										<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" />}</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />
								<br />
								<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />
						</span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000">制造一个类用于说明问题</span>
						<span style="COLOR: #008000">
								<br />
								<img id="_311_388_Open_Image" onclick="this.style.display='none'; document.getElementById('_311_388_Open_Text').style.display='none'; document.getElementById('_311_388_Closed_Image').style.display='inline'; document.getElementById('_311_388_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" />
								<img id="_311_388_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_311_388_Closed_Text').style.display='none'; document.getElementById('_311_388_Open_Image').style.display='inline'; document.getElementById('_311_388_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" />
						</span>
						<span style="COLOR: #0000ff">class</span>
						<span style="COLOR: #000000"> Product</span>
						<font color="#ff0000">
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000">T</span>
								<span style="COLOR: #000000">&gt;</span>
						</font>
						<span style="COLOR: #000000"> </span>
						<span id="_311_388_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span>
						<span id="_311_388_Open_Text">
								<span style="COLOR: #000000">{<br /><img id="_349_386_Open_Image" onclick="this.style.display='none'; document.getElementById('_349_386_Open_Text').style.display='none'; document.getElementById('_349_386_Closed_Image').style.display='inline'; document.getElementById('_349_386_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" /><img id="_349_386_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_349_386_Closed_Text').style.display='none'; document.getElementById('_349_386_Open_Image').style.display='inline'; document.getElementById('_349_386_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" />    </span>
								<span style="COLOR: #0000ff">public</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">void</span>
								<span style="COLOR: #000000"> prt(List</span>
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000">String</span>
								<span style="COLOR: #000000">&gt;</span>
								<span style="COLOR: #000000"> lt) </span>
								<span id="_349_386_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span>
								<span id="_349_386_Open_Text">
										<span style="COLOR: #000000">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" />        System.out.println(lt);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" />    }</span>
								</span>
								<span style="COLOR: #000000">
										<br />
										<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" />}</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />
								<br />
								<img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" _fcksavedurl="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />
						</span>
				</div>
		</div>
		<p>编译器说使用了未经检查或不安全的操作，但能编译通过并运行显示 [1, 2]。</p>
		<p>这又是为什么呢？就是红色的那一个&lt;T&gt;就变化这么大吗？似乎不是和刚才效果应该一样拉，怎么这回又可以了？</p>
		<p>原因是这样的：第次程序里面，只是把class Product改成了class Product&lt;T&gt;，尽管类型T在Product的代码里压根从没用到，但是这个定义把一个普通类（class）变成了原始类型（raw class）。generic class Product&lt;T&gt;在JVM运行时是不存在的,Product这个原始类型不是类型安全的。因为在new Product.prt(list)里面，使用的是原始类型的Product，所以里面的list也会被擦拭成原始类型的，所以类型就符合了，不会有编译错误而可以运行。</p>
		<p>虽然这个时候程序尽管可以运行，但其使用泛型的方法，无疑是错误的。 在这里我只是想和大家分析一些泛型的细节问题。要大家通过这个细节明白泛型的细节之处(檫试，原始类型)。具体的内容我就不在说了，很多书都有。推荐java参考大全5edition page264 和 core Java I 7edition Chapter 13. Generic Programming  <br /><br /></p>
<img src ="http://www.blogjava.net/livahu/aggbug/66208.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/livahu/" target="_blank">livahu</a> 2006-08-28 16:19 <a href="http://www.blogjava.net/livahu/archive/2006/08/28/66208.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>The 10 Things You Need to Know About Java SE 6 'Mustang' </title><link>http://www.blogjava.net/livahu/archive/2006/08/28/66206.html</link><dc:creator>livahu</dc:creator><author>livahu</author><pubDate>Mon, 28 Aug 2006 08:16:00 GMT</pubDate><guid>http://www.blogjava.net/livahu/archive/2006/08/28/66206.html</guid><wfw:comment>http://www.blogjava.net/livahu/comments/66206.html</wfw:comment><comments>http://www.blogjava.net/livahu/archive/2006/08/28/66206.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/livahu/comments/commentRss/66206.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/livahu/services/trackbacks/66206.html</trackback:ping><description><![CDATA[
		<div id="text">
				<p>
						<span style="FONT-WEIGHT: bold">The 10 Things You Need to Know About Java SE 6 'Mustang' <br /><br />Need a digest, summary, compressed form, precis of what's up with <a href="http://java.sun.com/javase/6/"><font color="#002c99">Java SE 6</font></a> 'Mustang', currently in beta ?<br /><br />Here it is, the top 10 things <a href="http://blogs.sun.com/roller/page/dannycoward/20060317"><font color="#002c99">you</font></a> need to know.</span>
				</p>
				<p>
						<span style="FONT-WEIGHT: bold">1. Web Services</span>
						<br />
						<br />All developers get first class support for writing XML web service client applications. No messing with the plumbing, you can expose your APIs as .NET interoperable web services with a <a href="http://blogs.sun.com/roller/page/dannycoward/20060227"><font color="#002c99">simple annotation</font></a>. Not your style ? Want to handle the XML directly ? Knock yourself out: Mustang adds new parsing and XML to Java object mapping APIs, previously only available in <a href="http://java.sun.com/javaee/index.jsp"><font color="#002c99">Java EE</font></a> implementations or the <a href="http://java.sun.com/webservices/jwsdp/index.jsp"><font color="#002c99">Java Web Services Pack</font></a>.<br /><br /><span style="FONT-WEIGHT: bold">2. Scripting</span><br /><br />You can now mix in JavaScript with your Java Source code, useful for prototyping, or when you have teams with a variety of skill sets. More advanced developers can plug in their own scripting engines, and mix their favorite scripting language in with Java as they see fit. <br /><br /><big><span style="FONT-WEIGHT: bold; COLOR: rgb(0,0,0)">P</span></big>erhaps <big><span style="FONT-WEIGHT: bold">Y</span></big>ou <big><span style="FONT-WEIGHT: bold">T</span></big>houg<big><span style="FONT-WEIGHT: bold">H</span></big>t y<big><span style="FONT-WEIGHT: bold">O</span></big>u could<big><span style="FONT-WEIGHT: bold">N</span></big>'t program with a scripting language and Java togethe<big><span style="FONT-WEIGHT: bold">R</span></big>. Which will yo<big><span style="FONT-WEIGHT: bold">U</span></big><big><span style="FONT-WEIGHT: bold">B</span></big>e tr<big><span style="FONT-WEIGHT: bold">Y</span></big>ing ?<br /><span style="FONT-WEIGHT: bold"><br /></span><span style="FONT-WEIGHT: bold">3. Database</span><br /><br />All developers get the updated JDBC 4.0, which is a new upgrade of a well-used API, focusing mainly on making it easier to use, although there are many <a href="http://weblogs.java.net/blog/lancea/"><font color="#002c99">feature additions</font></a> like special support for XML as an SQL datatype, and better integration of BLOBs and CLOBs into the APIs. My favorite ease of use things include removal of some JDBC <a href="http://weblogs.java.net/blog/kgh/archive/2005/11/my_favorite_dea.html"><font color="#002c99">boilerplate</font></a>, and some of the new annotations which make SQL strings embed better into your JDBC application. Like decorating your <span style="FONT-WEIGHT: bold">getAllUsers()</span> method with an <span style="FONT-WEIGHT: bold">@Query(sql="select * from user")</span> annotation, and that being all you need. <br /><br /><span style="FONT-WEIGHT: bold">4. More Desktop APIs</span><br /><br />Much has been said about this <a href="http://weblogs.java.net/blog/chet/archive/2006/02/these_are_some.html"><font color="#002c99">spoonful of sugar</font></a> (to go with the desktop team's <a href="http://weblogs.java.net/blog/zixle/archive/2006/03/free_chocolate.html"><font color="#002c99">cake</font></a>), so I will only skim a little. GUI developers get a large number of new tricks to play like the ever popular yet newly incorporated SwingWorker utility to help you with threading in GUI apps, JTable sorting and filtering and a new facility for quick splash screens to quieten impatient users. <br /><br /><span style="FONT-WEIGHT: bold">5. Monitoring and Management</span><br /><br />Really the big deal here is that you don't need do anything special to the startup to be able to attach on demand with any of the <a href="http://blogs.sun.com/roller/page/dannycoward/20060310"><font color="#002c99">monitoring and management tools in Java SE</font></a>. Mustang adds yet more diagnostic information, and we cobundled the infamous memory heap analysis tool <a href="http://java.sun.com/javase/6/docs/tooldocs/share/jhat.html"><font color="#002c99">jhat</font></a> for forensic explorations of those core dumps.<br /><br /><span style="FONT-WEIGHT: bold">6. Compiler Access</span><br /><br />Really aimed at people who create tools for Java development, and for frameworks like JSP or PHP engines that need to generate a bunch of classes on demand, the compiler API opens up programmatic access to javac for in-process compilation of dynamically generate Java code. Not directly intended for the everyday developer, but for those of you deafened by your screaming inner geek, <a href="http://blogs.sun.com/ahe?entry=somebody_noticed_jsr_199"><font color="#002c99">roll up your sleeves</font></a> and give it a try. And the rest of us will happily benefit from the <a href="http://www.netbeans.org/community/releases/50/index.html"><font color="#002c99">tools</font></a> and the improved Java frameworks that use this.<br /><br /><span style="FONT-WEIGHT: bold">7. Pluggable Annotations</span><br /><br />Its becoming a running joke in Java circles, at least some that contain me, that for every <a href="http://blogs.sun.com/roller/page/gbracha?entry=annotations_toward_pluggable_types"><font color="#002c99">wished for feature</font></a> missing in Java, there's a budding <a href="http://wiki.java.net/bin/view/Javapedia/Annotations"><font color="#002c99">annotation</font></a> that will solve the problem. Joke no more, because Java tool and framework vendors can put a different smile on your face, defining their own annotations and have core support for plugging in and executing the processors that do the heaving lifting that can make custom annotations so cool.<br /><br style="FONT-WEIGHT: bold" /><span style="FONT-WEIGHT: bold">8. Desktop Deployment</span><br /><br />Those of you deploying applications to the desktop will soon discover that its a tale of a large number of <a href="http://java.sun.com/developer/technicalArticles/J2SE/Desktop/mustang/"><font color="#002c99">smaller changes</font></a> that add up to a big difference to existing applications. Like better platform look &amp; feels in Swing, LCD text rendering, and snappier GUI performance overall.  Java apps can integrate better with the native platform with things like new access to the System Tray and Start menu of the platform.  At long last, Mustang unifies the Java Plugin and Java WebStart engines which just makes sense. Java WebStart application installation got a much needed <a href="http://weblogs.java.net/blog/stanleyh/archive/2005/04/deployment_good_1.html"><font color="#002c99">makeover</font></a>.<br /><br /><span style="FONT-WEIGHT: bold">9. Security</span><br /><br />You can have all the security features you like in the platform (and Mustang adds a few more, like the <a href="http://java.sun.com/webservices/docs/2.0/xmldsig/api/"><font color="#002c99">XML-DSIG APIs</font></a> for creating and manipulating digital signatures), but if you don't have well supported security administrators, your security may be at risk. So Mustang has simplified the job of its security administrators by providing various new ways to access platform native security services such as native PKI and cryptographic services on Windows for secure authentication and communication, GSS/Kerberos services for authentication, and access to LDAP servers for authenticating users.<br /><br style="FONT-WEIGHT: bold" /><span style="FONT-WEIGHT: bold">10. The Ilities: Quality, Compatibility, Stability</span><br /><br />You probably knew that Sun has done regular feature releases of the Java SE platform over the last 10 years, so we certainly feel like we've built up some expertise in this area (the ever growing 80,000 test cases and several million lines of code testing <a href="http://blog.sun.com/roller/page/pcurran/20060201"><font color="#002c99">conformance</font></a> being just one aspect of our testing activity), but different from the last release, you probably noticed that people have been downloading <a href="https://mustang.dev.java.net/"><font color="#002c99">snapshots of Mustang</font></a> for the last fifteen (not just six) months. And what's more they've been filing bugs. And what's even more we've (and some of you!) been fixing them as we go. We're even <a href="https://mustang.dev.java.net/regchal/"><font color="#002c99">challenging </font></a>people to find more. So unlike previous releases, before we even got to <a href="http://java.sun.com/javase/6/"><font color="#002c99">beta</font></a>, we'd fixed a number of quality and regression issues. Doesn't that add up to a better product ? Oh, and by the way, performance is looking better than Java SE 5 'Tiger'. <i>Already..</i><br /><br />So now you know all you need to know. Go on, try it !</p>
				<p> </p>
				<p>
						<font color="#ff3300">The message comes from sun weblog My short BIO<br /></font>
				</p>
		</div>
<img src ="http://www.blogjava.net/livahu/aggbug/66206.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/livahu/" target="_blank">livahu</a> 2006-08-28 16:16 <a href="http://www.blogjava.net/livahu/archive/2006/08/28/66206.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>