<?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: Simple example to demonstrate that String object is immutable</title>
	<atom:link href="http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/feed" rel="self" type="application/rss+xml" />
	<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31</link>
	<description>a new play everyday</description>
	<lastBuildDate>Wed, 08 Feb 2012 14:35:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Vinay</title>
		<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/comment-page-1#comment-11919</link>
		<dc:creator>Vinay</dc:creator>
		<pubDate>Wed, 08 Feb 2012 11:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://techtamasha.com/?p=31#comment-11919</guid>
		<description>@nishal 
What I meant was not against you or something.We all are sayin the same thing.
But my only point was that I kinda off got why &quot;Pradeep&quot; was getting confused.So that example i gave was just to let him know the other side.Its like sometimes the same story told in a different way can clear the air nothing much. Anyways nice tutorial.I have read your other posts as well.Do belive you have a good way to explain technical stuffs keep it on,</description>
		<content:encoded><![CDATA[<p>@nishal<br />
What I meant was not against you or something.We all are sayin the same thing.<br />
But my only point was that I kinda off got why &#8220;Pradeep&#8221; was getting confused.So that example i gave was just to let him know the other side.Its like sometimes the same story told in a different way can clear the air nothing much. Anyways nice tutorial.I have read your other posts as well.Do belive you have a good way to explain technical stuffs keep it on,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manoj</title>
		<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/comment-page-1#comment-11841</link>
		<dc:creator>Manoj</dc:creator>
		<pubDate>Thu, 02 Feb 2012 05:25:02 +0000</pubDate>
		<guid isPermaLink="false">http://techtamasha.com/?p=31#comment-11841</guid>
		<description>thanks all of one........</description>
		<content:encoded><![CDATA[<p>thanks all of one&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raghavender</title>
		<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/comment-page-1#comment-11836</link>
		<dc:creator>Raghavender</dc:creator>
		<pubDate>Thu, 02 Feb 2012 03:22:18 +0000</pubDate>
		<guid isPermaLink="false">http://techtamasha.com/?p=31#comment-11836</guid>
		<description>Both Nischal and Vinay are trying to say the same thing...here&#039;s Nischal&#039;s example with Vinay&#039;s explanation....

String s = “Let’s test”;
//this object(&quot;Let&#039;s test&quot;) is created,say,in memory location: 2012
 
s.concat(” if the String object is IMMUTABLE”);
//since String objects are immutable, the object in memorylocation:2012 cannot be destroyed, replaced or overridden. Instead s.concat creates a new object(“Let&#039;s test if the String object is IMMUTABLE” ) in the next available memory location,say,2022.
 
System.out.println(s);
//since s still references the memorylocation:2012, it prints only the first object &quot;Let&#039;s test&quot;.
 
s = s.concat(” if the String object is IMMUTABLE”);
//Step 2 gets repeated again.  s.concat creates a new object(“Let&#039;s test if the String object is IMMUTABLE” ) in the next available memory location:2065. However the additional assignment of s changes the scenario totally. Now s is made to reference the memorylocation:2065. 

 
System.out.println(s);
//Since s points to memorylocation:2065, it will print the object &quot;Let&#039;s test if the String object is IMMUTABLE&quot;. Hence the output!!
 
The output of the above code will be:
 
Let’s test
 
Let’s test if the String object is IMMUTABLE</description>
		<content:encoded><![CDATA[<p>Both Nischal and Vinay are trying to say the same thing&#8230;here&#8217;s Nischal&#8217;s example with Vinay&#8217;s explanation&#8230;.</p>
<p>String s = “Let’s test”;<br />
//this object(&#8220;Let&#8217;s test&#8221;) is created,say,in memory location: 2012</p>
<p>s.concat(” if the String object is IMMUTABLE”);<br />
//since String objects are immutable, the object in memorylocation:2012 cannot be destroyed, replaced or overridden. Instead s.concat creates a new object(“Let&#8217;s test if the String object is IMMUTABLE” ) in the next available memory location,say,2022.</p>
<p>System.out.println(s);<br />
//since s still references the memorylocation:2012, it prints only the first object &#8220;Let&#8217;s test&#8221;.</p>
<p>s = s.concat(” if the String object is IMMUTABLE”);<br />
//Step 2 gets repeated again.  s.concat creates a new object(“Let&#8217;s test if the String object is IMMUTABLE” ) in the next available memory location:2065. However the additional assignment of s changes the scenario totally. Now s is made to reference the memorylocation:2065. </p>
<p>System.out.println(s);<br />
//Since s points to memorylocation:2065, it will print the object &#8220;Let&#8217;s test if the String object is IMMUTABLE&#8221;. Hence the output!!</p>
<p>The output of the above code will be:</p>
<p>Let’s test</p>
<p>Let’s test if the String object is IMMUTABLE</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: muthu</title>
		<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/comment-page-1#comment-11771</link>
		<dc:creator>muthu</dc:creator>
		<pubDate>Sun, 29 Jan 2012 05:58:15 +0000</pubDate>
		<guid isPermaLink="false">http://techtamasha.com/?p=31#comment-11771</guid>
		<description>Nice clarification...</description>
		<content:encoded><![CDATA[<p>Nice clarification&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prashant</title>
		<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/comment-page-1#comment-11300</link>
		<dc:creator>Prashant</dc:creator>
		<pubDate>Tue, 13 Dec 2011 11:15:46 +0000</pubDate>
		<guid isPermaLink="false">http://techtamasha.com/?p=31#comment-11300</guid>
		<description>Its really good and helpful for those who are novice...</description>
		<content:encoded><![CDATA[<p>Its really good and helpful for those who are novice&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deepak</title>
		<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/comment-page-1#comment-11106</link>
		<dc:creator>Deepak</dc:creator>
		<pubDate>Fri, 09 Dec 2011 09:24:33 +0000</pubDate>
		<guid isPermaLink="false">http://techtamasha.com/?p=31#comment-11106</guid>
		<description>Thank you</description>
		<content:encoded><![CDATA[<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nischal Shetty</title>
		<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/comment-page-1#comment-10950</link>
		<dc:creator>Nischal Shetty</dc:creator>
		<pubDate>Sat, 26 Nov 2011 09:01:42 +0000</pubDate>
		<guid isPermaLink="false">http://techtamasha.com/?p=31#comment-10950</guid>
		<description>@Vinay I&#039;m sorry I do not agree with that... It&#039;s not security that needed String to be immutable....

Strings were made immutable because at any given point multiple variables can refer to the same object... It would lead to inconsistencies if the objects could be changed.</description>
		<content:encoded><![CDATA[<p>@Vinay I&#8217;m sorry I do not agree with that&#8230; It&#8217;s not security that needed String to be immutable&#8230;.</p>
<p>Strings were made immutable because at any given point multiple variables can refer to the same object&#8230; It would lead to inconsistencies if the objects could be changed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ravi</title>
		<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/comment-page-1#comment-10938</link>
		<dc:creator>ravi</dc:creator>
		<pubDate>Fri, 25 Nov 2011 05:55:18 +0000</pubDate>
		<guid isPermaLink="false">http://techtamasha.com/?p=31#comment-10938</guid>
		<description>@vinay guru:excellent comment</description>
		<content:encoded><![CDATA[<p>@vinay guru:excellent comment</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Namrata</title>
		<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/comment-page-1#comment-10570</link>
		<dc:creator>Namrata</dc:creator>
		<pubDate>Mon, 24 Oct 2011 18:14:20 +0000</pubDate>
		<guid isPermaLink="false">http://techtamasha.com/?p=31#comment-10570</guid>
		<description>Indeed very helpful !</description>
		<content:encoded><![CDATA[<p>Indeed very helpful !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohan</title>
		<link>http://www.techtamasha.com/simple-example-to-demonstrate-that-string-object-is-immutable/31/comment-page-1#comment-9771</link>
		<dc:creator>Mohan</dc:creator>
		<pubDate>Fri, 02 Sep 2011 09:58:47 +0000</pubDate>
		<guid isPermaLink="false">http://techtamasha.com/?p=31#comment-9771</guid>
		<description>Nice tutorial..
Thanks a lot.</description>
		<content:encoded><![CDATA[<p>Nice tutorial..<br />
Thanks a lot.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

