﻿<?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-求索</title><link>http://www.blogjava.net/Longbow/</link><description>Make it work, make it right, make it fast and make it open。</description><language>zh-cn</language><lastBuildDate>Sat, 18 Apr 2026 12:04:32 GMT</lastBuildDate><pubDate>Sat, 18 Apr 2026 12:04:32 GMT</pubDate><ttl>60</ttl><item><title>Vote on the eclipse.org redesign! </title><link>http://www.blogjava.net/Longbow/archive/2005/09/02/11829.html</link><dc:creator>Java求索</dc:creator><author>Java求索</author><pubDate>Fri, 02 Sep 2005 04:54:00 GMT</pubDate><guid>http://www.blogjava.net/Longbow/archive/2005/09/02/11829.html</guid><wfw:comment>http://www.blogjava.net/Longbow/comments/11829.html</wfw:comment><comments>http://www.blogjava.net/Longbow/archive/2005/09/02/11829.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Longbow/comments/commentRss/11829.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Longbow/services/trackbacks/11829.html</trackback:ping><description><![CDATA[<P><FONT face=Verdana size=2>几天之前就听说Eclipse官方网站要改版，今天又看到了在EclipseZone上让大家投票选首页的Skin，网站上提供了三种皮肤。每个都不错，不过我最喜欢第一个。<BR></FONT></P><A href="http://dev.eclipse.org/newslists/news.eclipse.technology.phoenix/pngytVqr3zQoZ.png"><IMG style="WIDTH: 397px; HEIGHT: 251px" height=454 alt=eclipse.org src="http://dev.eclipse.org/newslists/news.eclipse.technology.phoenix/pngytVqr3zQoZ.png" width=365 align=right/></A>&nbsp;<FONT face=Verdana size=2><FONT size=1>（Click on the image for a bigger version）<BR></FONT>其他Skin：</FONT><A href="http://www.eclipsezone.com/java/forums/t44832.html"><FONT face=Verdana size=2>http://www.eclipsezone.com/java/forums/t44832.html</FONT></A><BR><FONT face=Verdana size=2>自从我开始用Eclipse，看到的eclipse.org的页面就一直是老样子，原来内容少的时候用着还可以，现在内容多了很多，总感觉找起资料来非常费劲，有一种很乱的感觉。是该改一改了！</FONT><img src ="http://www.blogjava.net/Longbow/aggbug/11829.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Longbow/" target="_blank">Java求索</a> 2005-09-02 12:54 <a href="http://www.blogjava.net/Longbow/archive/2005/09/02/11829.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse 3.2M1发布</title><link>http://www.blogjava.net/Longbow/archive/2005/08/14/10061.html</link><dc:creator>Java求索</dc:creator><author>Java求索</author><pubDate>Sun, 14 Aug 2005 00:05:00 GMT</pubDate><guid>http://www.blogjava.net/Longbow/archive/2005/08/14/10061.html</guid><wfw:comment>http://www.blogjava.net/Longbow/comments/10061.html</wfw:comment><comments>http://www.blogjava.net/Longbow/archive/2005/08/14/10061.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/Longbow/comments/commentRss/10061.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Longbow/services/trackbacks/10061.html</trackback:ping><description><![CDATA[感觉3.1好像昨天才刚刚发布，今天3.2M1就呈现在人们的面前。3.2M1在UI上的最大的改变就是启动进度条终于集成到了Splash Screen上了。<BR><IMG height=295 alt=o_startup.png src="http://www.blogjava.net/images/blogjava_net/longbow/2700/o_startup.png" width=455 border=0><BR>而传说中的<A href="http://www.eclipsezone.com/java/forums/t43649.html">SWT.VERTICAL style Coolbars</A>却没有出现。也许会在下一个版本中加入吧！期待中……。不过，Eclipse的UI真的是越来越漂亮了。<BR><A href="http://download.eclipse.org/eclipse/downloads/drops/S-3.2M1-200508111530/eclipse-news-M1.html">更多New and Noteworthy</A><BR><A href="http://www.eclipse.org/downloads/index.php">下载</A><img src ="http://www.blogjava.net/Longbow/aggbug/10061.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Longbow/" target="_blank">Java求索</a> 2005-08-14 08:05 <a href="http://www.blogjava.net/Longbow/archive/2005/08/14/10061.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>从控制台启动eclipse</title><link>http://www.blogjava.net/Longbow/archive/2005/07/27/8561.html</link><dc:creator>Java求索</dc:creator><author>Java求索</author><pubDate>Wed, 27 Jul 2005 09:39:00 GMT</pubDate><guid>http://www.blogjava.net/Longbow/archive/2005/07/27/8561.html</guid><wfw:comment>http://www.blogjava.net/Longbow/comments/8561.html</wfw:comment><comments>http://www.blogjava.net/Longbow/archive/2005/07/27/8561.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/Longbow/comments/commentRss/8561.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Longbow/services/trackbacks/8561.html</trackback:ping><description><![CDATA[<!--StartFragment --><FONT face=Verdana size=2>我在试着使用Hyades测试项目的时候，知道了Eclipse还可以从控制台启动：<BR>在控制台中输入<BR></FONT>
<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: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><FONT face=Verdana><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000"><a title="" href="http://java.sun.com" >Java</a>&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">XrunpiAgent&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">classpath&nbsp;.</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">startup.jar&nbsp;org.eclipse.core.launcher.Main&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">data&nbsp;.</SPAN><SPAN style="COLOR: #000000">/my_</SPAN><SPAN style="COLOR: #000000">workspace</SPAN></FONT></FONT></DIV></DIV><BR><FONT face=Verdana size=2>其中：<BR><STRONG>-XrunpiAgent：</STRONG> 可以不加，这是为了启动Hyades的Agent controller用的。<BR><STRONG>-classpath ./startup.jar：</STRONG> 要是指定eclipse目录下startup.jar文件的位置。<BR><STRONG>-data ./workspace-new：</STRONG> -data常用的一个启动参数，用来指定eclipse项目文件的位置。</FONT><img src ="http://www.blogjava.net/Longbow/aggbug/8561.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Longbow/" target="_blank">Java求索</a> 2005-07-27 17:39 <a href="http://www.blogjava.net/Longbow/archive/2005/07/27/8561.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>String pool</title><link>http://www.blogjava.net/Longbow/archive/2005/07/15/7742.html</link><dc:creator>Java求索</dc:creator><author>Java求索</author><pubDate>Fri, 15 Jul 2005 01:31:00 GMT</pubDate><guid>http://www.blogjava.net/Longbow/archive/2005/07/15/7742.html</guid><wfw:comment>http://www.blogjava.net/Longbow/comments/7742.html</wfw:comment><comments>http://www.blogjava.net/Longbow/archive/2005/07/15/7742.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/Longbow/comments/commentRss/7742.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Longbow/services/trackbacks/7742.html</trackback:ping><description><![CDATA[<FONT face=Verdana size=2>今天写代码涉及到大量的String操作，突然间想起一些关于String与其它class的不同之处，我是我以前在一篇文章上看到的，具体出处实在记不得了，现在加上一点儿自己的理解记录下来，以作备忘。<BR><BR>String的特殊之处就是它可以像int等简单类型一样，使用“=”来生成一个Object，而不必用<STRONG><FONT style="BACKGROUND-COLOR: #ffffff" color=#000080>new</FONT></STRONG>这个关键字，为什么呢？先来看下面的代码：<BR>
<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: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">import&nbsp;junit.framework.TestCase;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_79_516_Open_Image onclick="this.style.display='none'; Codehighlighter1_79_516_Open_Text.style.display='none'; Codehighlighter1_79_516_Closed_Image.style.display='inline'; Codehighlighter1_79_516_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_79_516_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_79_516_Closed_Text.style.display='none'; Codehighlighter1_79_516_Open_Image.style.display='inline'; Codehighlighter1_79_516_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;TestStringPool&nbsp;extends&nbsp;TestCase&nbsp;</SPAN><SPAN id=Codehighlighter1_79_516_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"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_79_516_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;String&nbsp;string1;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;String&nbsp;string2;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG id=Codehighlighter1_166_222_Open_Image onclick="this.style.display='none'; Codehighlighter1_166_222_Open_Text.style.display='none'; Codehighlighter1_166_222_Closed_Image.style.display='inline'; Codehighlighter1_166_222_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_166_222_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_166_222_Closed_Text.style.display='none'; Codehighlighter1_166_222_Open_Image.style.display='inline'; Codehighlighter1_166_222_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">protected</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;setUp()&nbsp;</SPAN><SPAN id=Codehighlighter1_166_222_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"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_166_222_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string1&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">abc</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string2&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">abc</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG id=Codehighlighter1_258_304_Open_Image onclick="this.style.display='none'; Codehighlighter1_258_304_Open_Text.style.display='none'; Codehighlighter1_258_304_Closed_Image.style.display='inline'; Codehighlighter1_258_304_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_258_304_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_258_304_Closed_Text.style.display='none'; Codehighlighter1_258_304_Open_Image.style.display='inline'; Codehighlighter1_258_304_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;testStringPool()&nbsp;</SPAN><SPAN id=Codehighlighter1_258_304_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"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_258_304_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertTrue(string1&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;string2);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG id=Codehighlighter1_339_514_Open_Image onclick="this.style.display='none'; Codehighlighter1_339_514_Open_Text.style.display='none'; Codehighlighter1_339_514_Closed_Image.style.display='inline'; Codehighlighter1_339_514_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_339_514_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_339_514_Closed_Text.style.display='none'; Codehighlighter1_339_514_Open_Image.style.display='inline'; Codehighlighter1_339_514_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;testNewString()&nbsp;</SPAN><SPAN id=Codehighlighter1_339_514_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"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_339_514_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string1&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;String(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">abc</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string2&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;String(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">abc</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertFalse(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">The&nbsp;objects&nbsp;don't&nbsp;use&nbsp;the&nbsp;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;pool</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;string1&nbsp;==&nbsp;string2);</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN></DIV></DIV></FONT>
<P><FONT face=Verdana><FONT size=2><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">这里用到了</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">JUnit</SPAN><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">，用来测试</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">String pool</SPAN><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"></SPAN></FONT></FONT></P>
<P><FONT face=Verdana size=2></FONT>
<P><FONT face=Verdana><FONT size=2><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">第一个测试，说明两个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">String</SPAN><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">是同一个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">Object</SPAN><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">，（</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">==</SPAN><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">就是用来比较</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">object</SPAN><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">reference</SPAN><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">）。而第二个测试则说明两个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">String Object</SPAN><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">不同。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"></SPAN></FONT></FONT></P>
<P><FONT face=Verdana size=2></FONT>
<P><FONT face=Verdana><FONT size=2><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">众所周知，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"><a title="" href="http://java.sun.com" >Java</a></SPAN><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">String</SPAN><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">是<SPAN class=postbody>不可改变的字符串对象。为了提高效率，</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"><a title="" href="http://java.sun.com" >Java</a></SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">为</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">String</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">类提供了串池(String pool)。正如大家所看到的那样，在第一个</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">test</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">中就使用了串池。当你重新声明一个</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">String</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">型变量为</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">abc</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">时，将使用串池里原来的那个</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">abc</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">，而不重新分配内存，也就是说，</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">string2</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">与</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">string1</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">将会指向同一块内存。所以结果为</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">true</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">。在</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">第二个test case</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">中使用了普通对象的声明方式，系统将会为</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">string1</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">和</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">string2</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">各分配一块内存。所以结果为</SPAN></SPAN><SPAN class=postbody><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana">false</SPAN></SPAN><SPAN class=postbody><SPAN style="FONT-SIZE: 9pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">。</SPAN><SPAN lang=EN-US></SPAN></SPAN></FONT></FONT></P>
<P><FONT face=Verdana size=2></FONT>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; mso-bidi-font-family: 'Times New Roman'"><FONT face=Verdana size=2></FONT></SPAN>
<P><FONT face=Verdana size=2></FONT></P>
<P><FONT face=Verdana size=2>&nbsp;结论：我们比较两个String的值，最好用equals()方法，而最好不要使用==。这就避免了一些不必要的麻烦。另外，声明String的时候，最好用=，这样就可以体现String pool的作用了。</FONT></P><img src ="http://www.blogjava.net/Longbow/aggbug/7742.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Longbow/" target="_blank">Java求索</a> 2005-07-15 09:31 <a href="http://www.blogjava.net/Longbow/archive/2005/07/15/7742.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>WordPress在PHP5下的安装</title><link>http://www.blogjava.net/Longbow/archive/2005/07/13/7651.html</link><dc:creator>Java求索</dc:creator><author>Java求索</author><pubDate>Wed, 13 Jul 2005 08:57:00 GMT</pubDate><guid>http://www.blogjava.net/Longbow/archive/2005/07/13/7651.html</guid><wfw:comment>http://www.blogjava.net/Longbow/comments/7651.html</wfw:comment><comments>http://www.blogjava.net/Longbow/archive/2005/07/13/7651.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/Longbow/comments/commentRss/7651.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Longbow/services/trackbacks/7651.html</trackback:ping><description><![CDATA[<P><FONT face=Verdana size=2>&nbsp;&nbsp;&nbsp;&nbsp; 原来一直听说wordpress很好，是用php做的。由于前几天开始接触PHP，所以今天就试着在自己pc上安装wordpress。我用的是PHP的最新版本，PHP5。刚开始我按照wordpress的readme文件一步步地安装，首先apache http server，然后PHP5，wordpress。最后修改wp-config文件里的Database设置，打开浏览器，本以为可以大功告成了。但是运行/wp-admin目录里的install.php文件，却提示我"Your PHP installation appears to be missing the MySQL which is required for WordPress." 于是我就检查mysql的DB_NAME，DB_USER，DB_PASSWORD，DB_HOST，都对啊。怎么会呢？</FONT></P>
<P><FONT face=Verdana size=2>百思不得其解，实在没有办法了，我就一遍一遍的查PHP的文档，后来终于在FAQ里面找到了原因，原来是因为PHP5在默认情况下，不再提供mysql的支持，必须手动的设置。</FONT></P>
<P><FONT face=Verdana size=2>方法是：在PHP.ini文件激活php_mysql.dll扩展库,此外，要将php_mysql.dll拷贝到适当的 <TT class=literal>%SYSTEMROOT%</TT> 目录中.</FONT> </P><img src ="http://www.blogjava.net/Longbow/aggbug/7651.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Longbow/" target="_blank">Java求索</a> 2005-07-13 16:57 <a href="http://www.blogjava.net/Longbow/archive/2005/07/13/7651.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>windows IP影射</title><link>http://www.blogjava.net/Longbow/archive/2005/07/06/7216.html</link><dc:creator>Java求索</dc:creator><author>Java求索</author><pubDate>Wed, 06 Jul 2005 09:50:00 GMT</pubDate><guid>http://www.blogjava.net/Longbow/archive/2005/07/06/7216.html</guid><wfw:comment>http://www.blogjava.net/Longbow/comments/7216.html</wfw:comment><comments>http://www.blogjava.net/Longbow/archive/2005/07/06/7216.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/Longbow/comments/commentRss/7216.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Longbow/services/trackbacks/7216.html</trackback:ping><description><![CDATA[<P><FONT face=Verdana size=2>维护一个J2EE项目，经常需要修改client端所连接的server. 最麻烦的就是每次都需要把client里面的所有的config和properties文件里的IP地址改一遍。如果不小心忘掉几个，就会出现一些意想不到的错误。如果要避免这种麻烦的事情，可以用windows IP影射。</FONT></P>
<P><FONT face=Verdana size=2>具体方法：</FONT></P>
<P><FONT face=Verdana size=2>在windows安装目录修改\system32\drivers\etc\hosts:文件</FONT></P>
<P><FONT face=Verdana size=2>在文件里加上例如这样的字段</FONT></P>
<P><FONT face=Verdana size=2>123.456.0.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; abcde</FONT></P>
<P><FONT face=Verdana size=2>前面一段为IP地址，后面为一个任意的server名字，可以是任意的字符串。然后，在所有的属性文件里使用这个名字。以后再想更改server，就只需要修改hosts文件就行了。</FONT></P><img src ="http://www.blogjava.net/Longbow/aggbug/7216.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Longbow/" target="_blank">Java求索</a> 2005-07-06 17:50 <a href="http://www.blogjava.net/Longbow/archive/2005/07/06/7216.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于Generics的一点儿理解</title><link>http://www.blogjava.net/Longbow/archive/2005/07/06/7201.html</link><dc:creator>Java求索</dc:creator><author>Java求索</author><pubDate>Wed, 06 Jul 2005 07:57:00 GMT</pubDate><guid>http://www.blogjava.net/Longbow/archive/2005/07/06/7201.html</guid><wfw:comment>http://www.blogjava.net/Longbow/comments/7201.html</wfw:comment><comments>http://www.blogjava.net/Longbow/archive/2005/07/06/7201.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/Longbow/comments/commentRss/7201.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Longbow/services/trackbacks/7201.html</trackback:ping><description><![CDATA[<P><FONT face=Verdana size=2>JDK5.0已经release很久了，但一直没机会好好学习一下，今天可有机会了。</FONT></P>
<P><FONT face=Verdana size=2>先来看一段代码：<BR></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: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;TestDate&nbsp;{<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;main(String[]&nbsp;args)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Date&nbsp;date&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Date();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;</SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Object();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Timestamp&nbsp;stamp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Timestamp(date.getTime());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">date&amp;stamp:</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;date.compareTo(stamp));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">stamp&amp;date:</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;stamp.compareTo(date));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">date&amp;object:</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;date.compareTo(</SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">));<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}</SPAN></DIV></DIV>
<P><BR></P></FONT>
<P><FONT face=Verdana color=#000000 size=2>这段代码看上去很普通，但是如果用1.4和1.5分别编译就会出现不同的结果。先来说用1.4编译的情况：首先用1.4编译，编译器不会报错，如果运行的话，前面两个输出语句会分别打印“0，0”，而第三个会throw一个ClassCast exception. 因为Date不能与object比较，但是为什么能编译通过呢？察看JDK源代码就可以知道了，Date实现了Comparable接口，这个接口中的CompareTo()方法的参数就是Object。所以Date也不得不有一个以Object为参数的CompareTo()方法，但是这个方法是没有意义的，Date应该与Date比较，所以Date这个Class里面就出现了两个ComparaTo方法，一个是以Date为参数，另一个是以Object为参数，这是1.4以前，不得不采用的方法。不然Date就没法实现Comparable接口了。</FONT></P>
<P><FONT face=Verdana size=2>JDK1.5中Generics的出现解决了这个问题，如果看1.5中Date类的源代码的话，就会发现它只有一个CompareTo()方法了，那它怎么来实现Comparable接口呢，这就是Generics的功劳了。在Date声明时，实现Comparable接口是这么写的：...Comparable<DATE />...，并且Comparable接口的声明是这样的：Comparable<T />。这个T代表Type。它可以是任何Object。Comparable的实现类只要说明T是什么具体类型就可以了。因此，Date就可以只有一个CompareTo()方法，又可以实现Comparable接口了。如果用1.5编译上面的Code的话，就会发现这段Code是不能编译通过的，编译器会提示“Severity&nbsp;Description&nbsp;Resource&nbsp;In Folder&nbsp;Location&nbsp;Creation Time 2&nbsp;The method compareTo(Date) in the type Date is not applicable for the arguments (Object)”，这就避免了1.4中出现的问题。我想如果使用了1.5以后咱们编写代码时，出现ClassCastException的几率就会很小了，因为编译器会替你发现这样的错误。</FONT></P>
<P><FONT face=Verdana size=2>这就是Generics的好处了。</FONT></P>
<P><FONT face=Verdana size=2>但是还有一点值得考虑，如果我们去掉错误的那一行代码，在1.5中编译然后运行，会发现还有地方与1.4的不同。第一行输出语句会打印1，而不是0，这说明1.5认为具有相同时间的timestamp和date是不同的，但1.4认为它们相同。我有看了一下1.5和1.4的源代码，发现它们CompareTo(Date ...)的实现方法是不一样的，可能问题就出现在这里。我没有试着去读它的代码，等有时间，一定好好研究一下。</FONT></P>
<P><FONT face=Verdana size=2>最后，还有一个问题，如果用1.5编译并运行，会throw一个ClassCastException，而用1.4则不会出现这个问题。我想这是因为timestamp继承了Date的CompareTo()方法，所以一个timestamp就可以与Date比较了，但是应用了Generics以后这种情况是不允许的，而且代码也没有特殊处理，因此就会有Exception了。看来Generics也会带来一些其他的问题。</FONT></P>
<P><FONT face=Verdana size=2>我想这种情况是可以避免的，原则就是只比较具有相同类型的两个对象，而不与其父类或子类比较。如果必须比较的话，也应该用相应的方法转化为相同的类，再进行比较。</FONT></P><img src ="http://www.blogjava.net/Longbow/aggbug/7201.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Longbow/" target="_blank">Java求索</a> 2005-07-06 15:57 <a href="http://www.blogjava.net/Longbow/archive/2005/07/06/7201.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>iBatis2.1</title><link>http://www.blogjava.net/Longbow/archive/2005/05/20/iBatis.html</link><dc:creator>Java求索</dc:creator><author>Java求索</author><pubDate>Fri, 20 May 2005 01:32:00 GMT</pubDate><guid>http://www.blogjava.net/Longbow/archive/2005/05/20/iBatis.html</guid><wfw:comment>http://www.blogjava.net/Longbow/comments/4973.html</wfw:comment><comments>http://www.blogjava.net/Longbow/archive/2005/05/20/iBatis.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/Longbow/comments/commentRss/4973.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Longbow/services/trackbacks/4973.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: iBatis是一个简单易学的ORM实现，相对于现在比较流行的Hibernate等实现，它的特点就是简单，没有一些复杂的不太实用的功能，而且它的速度也非常快的。这就是我选择它的理由。iBatis的具体介绍，可以参考www.ibatis.com,并且网站上还提供中文文档，学习起来真的很方便。&nbsp;&nbsp;<a href='http://www.blogjava.net/Longbow/archive/2005/05/20/iBatis.html'>阅读全文</a><img src ="http://www.blogjava.net/Longbow/aggbug/4973.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Longbow/" target="_blank">Java求索</a> 2005-05-20 09:32 <a href="http://www.blogjava.net/Longbow/archive/2005/05/20/iBatis.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>