<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Java: String Equality (Common Mistake)</title>
	<atom:link href="http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/</link>
	<description>A passionate programmer's findings in the world of internet.</description>
	<lastBuildDate>Tue, 27 Jul 2010 15:27:18 -0400</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Rick O'Shay</title>
		<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/comment-page-1/#comment-90047</link>
		<dc:creator>Rick O'Shay</dc:creator>
		<pubDate>Tue, 03 Nov 2009 22:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/#comment-90047</guid>
		<description>The == operator generally works because the strings are pooled. String variables with the same contents usually end up &quot;pointing&quot; to the same object. 

If you rely on this optimization, sooner or later you will get burned. Consider a servlet where the incoming strings from a request are not defined as string constants but rather dynamically allocated. You should compare strings using the &quot;equals&quot; method, not the == operator.</description>
		<content:encoded><![CDATA[<p>The == operator generally works because the strings are pooled. String variables with the same contents usually end up &#8220;pointing&#8221; to the same object. </p>
<p>If you rely on this optimization, sooner or later you will get burned. Consider a servlet where the incoming strings from a request are not defined as string constants but rather dynamically allocated. You should compare strings using the &#8220;equals&#8221; method, not the == operator.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thank you</title>
		<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/comment-page-1/#comment-86625</link>
		<dc:creator>Thank you</dc:creator>
		<pubDate>Thu, 20 Aug 2009 07:06:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/#comment-86625</guid>
		<description>Thank you, good post!</description>
		<content:encoded><![CDATA[<p>Thank you, good post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seyfi</title>
		<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/comment-page-1/#comment-85915</link>
		<dc:creator>Seyfi</dc:creator>
		<pubDate>Mon, 03 Aug 2009 10:08:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/#comment-85915</guid>
		<description>thanks a lot ;)</description>
		<content:encoded><![CDATA[<p>thanks a lot <img src='http://blog.enrii.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Umakant</title>
		<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/comment-page-1/#comment-84789</link>
		<dc:creator>Umakant</dc:creator>
		<pubDate>Wed, 17 Jun 2009 22:47:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/#comment-84789</guid>
		<description>hey dude thank you very much.............

i have just wasted my 4 hours to do this.........


thanx</description>
		<content:encoded><![CDATA[<p>hey dude thank you very much&#8230;&#8230;&#8230;&#8230;.</p>
<p>i have just wasted my 4 hours to do this&#8230;&#8230;&#8230;</p>
<p>thanx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bobby LeMain</title>
		<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/comment-page-1/#comment-84590</link>
		<dc:creator>Bobby LeMain</dc:creator>
		<pubDate>Thu, 11 Jun 2009 17:25:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/#comment-84590</guid>
		<description>I was messing around with this the other day. Apparently there was an update, because

String b = &quot;b&quot;;
if(b == &quot;b&quot;)
//returns true as a .NET programmer would expect</description>
		<content:encoded><![CDATA[<p>I was messing around with this the other day. Apparently there was an update, because</p>
<p>String b = &#8220;b&#8221;;<br />
if(b == &#8220;b&#8221;)<br />
//returns true as a .NET programmer would expect</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PROG [JAVA] - 9lives</title>
		<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/comment-page-1/#comment-80804</link>
		<dc:creator>PROG [JAVA] - 9lives</dc:creator>
		<pubDate>Sat, 28 Feb 2009 13:42:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/#comment-80804</guid>
		<description>[...] Gurdt   das nie echt waar wa gij zegt he == vergelijk heel basisch de linker met de rechterkant    Java: String Equality (Common Mistake) - enrii.blog  dat dus. misschien gewoon slecht verwoord.    __________________ Gamertag: [...]</description>
		<content:encoded><![CDATA[<p>[...] Gurdt   das nie echt waar wa gij zegt he == vergelijk heel basisch de linker met de rechterkant    Java: String Equality (Common Mistake) &#8211; enrii.blog  dat dus. misschien gewoon slecht verwoord.    __________________ Gamertag: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: destrukthorts</title>
		<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/comment-page-1/#comment-76138</link>
		<dc:creator>destrukthorts</dc:creator>
		<pubDate>Fri, 31 Oct 2008 21:31:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/#comment-76138</guid>
		<description>Thanks!, im doing a java version of a simple, solid, python process, thx a lot :-b</description>
		<content:encoded><![CDATA[<p>Thanks!, im doing a java version of a simple, solid, python process, thx a lot :-b</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JavaLearner</title>
		<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/comment-page-1/#comment-76087</link>
		<dc:creator>JavaLearner</dc:creator>
		<pubDate>Thu, 30 Oct 2008 00:35:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/#comment-76087</guid>
		<description>Thank you ! I can now explain this to my daughter who is doing Java in high school.</description>
		<content:encoded><![CDATA[<p>Thank you ! I can now explain this to my daughter who is doing Java in high school.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Static on WAQ177 &#187; Java: String Equality (Common Mistake) - enrii.blog</title>
		<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/comment-page-1/#comment-73308</link>
		<dc:creator>Static on WAQ177 &#187; Java: String Equality (Common Mistake) - enrii.blog</dc:creator>
		<pubDate>Fri, 25 Jul 2008 03:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/#comment-73308</guid>
		<description>[...] [From  Java: String Equality (Common Mistake) - enrii.blog] [...]</description>
		<content:encoded><![CDATA[<p>[...] [From  Java: String Equality (Common Mistake) - enrii.blog] [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EngLee</title>
		<link>http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/comment-page-1/#comment-51467</link>
		<dc:creator>EngLee</dc:creator>
		<pubDate>Thu, 03 Jan 2008 01:53:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/#comment-51467</guid>
		<description>Feel free to correct me. I&#039;m no expert in Java string handling, I&#039;m just writing based on my experience. When I encounter problem, I find solution and I blog about it.

The example given is simply to show how two strings that look the same would go wrong when comparing with &quot;==&quot;. Most of the time, a programmer would have done some string manipulations before they compare the strings. After some manipulations, whether you declare with new or not, you will go wrong with &quot;==&quot;.

Anyway, why do you need to declare 2 strings with the same value?</description>
		<content:encoded><![CDATA[<p>Feel free to correct me. I&#8217;m no expert in Java string handling, I&#8217;m just writing based on my experience. When I encounter problem, I find solution and I blog about it.</p>
<p>The example given is simply to show how two strings that look the same would go wrong when comparing with &#8220;==&#8221;. Most of the time, a programmer would have done some string manipulations before they compare the strings. After some manipulations, whether you declare with new or not, you will go wrong with &#8220;==&#8221;.</p>
<p>Anyway, why do you need to declare 2 strings with the same value?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
