<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TechieDan &#187; loop</title>
	<atom:link href="http://techiedan.com/tag/loop/feed/" rel="self" type="application/rss+xml" />
	<link>http://techiedan.com</link>
	<description>Your Search for The Tech Stuffs</description>
	<lastBuildDate>Thu, 09 Feb 2012 02:59:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Cool New Loop in Java 5</title>
		<link>http://techiedan.com/2009/10/27/cool-new-loop-in-java-5/</link>
		<comments>http://techiedan.com/2009/10/27/cool-new-loop-in-java-5/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 09:17:13 +0000</pubDate>
		<dc:creator>techieDan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[java 5]]></category>
		<category><![CDATA[loop]]></category>

		<guid isPermaLink="false">http://techiedan.com/?p=612</guid>
		<description><![CDATA[<p>Most of us grew up with &#8220;<strong>Learn How To Program in C</strong>&#8220;. Then some of us shifted to <strong>JAVA</strong> due to the phrase, &#8220;<strong>Write Once, Run Everywhere</strong>&#8220;. Now back then, learning to write a loop in those days are considered good programming practice during the C Programming era. TechieDan even has his experiences on C [...]]]></description>
			<content:encoded><![CDATA[<p>Most of us grew up with &#8220;<strong>Learn How To Program in C</strong>&#8220;. Then some of us shifted to <strong>JAVA</strong> due to the phrase, &#8220;<strong>Write Once, Run Everywhere</strong>&#8220;. Now back then, learning to write a loop in those days are considered good programming practice during the C Programming era. TechieDan even has his experiences on C Program and even wrote his own source using the <strong>goto</strong> method. (<em>goto method is definitely not a good programming practice</em>)</p>
<p>For reference sake, this is how a <strong>for loop</strong> is written in Java.</p>
<p><img class="alignnone size-full wp-image-620" title="Rope Loop" src="http://techiedan.com/wp-content/uploads/2009/10/Loop.jpg" alt="Rope Loop" width="328" height="448" /><span style="text-decoration: underline;"><strong><br />
No! Not a Rope Loop. A Java Loop</strong></span></p>
<pre>
int[] total = {1,2,3,4,5};
int node = 0;

for (int i=0; i<5; i++) {
node = total[i];
System.out.println(node);
}
</pre>
<p>The above would then display the result as shown below.</p>
<blockquote><p>1<br />
2<br />
3<br />
4<br />
5</p></blockquote>
<p>For the non-programmies, these seem like Greek to them. For programmies, these are just simple FOR LOOP methods. The above was written in reference before Java 5 has broke into this era. Now what if the start of Java 5 has brought upon a new era just like how <a title="Autoboxing Java 5" href="http://techiedan.com/2009/10/20/autoboxing-java-5/" target="_blank">Autoboxing was introduced in Java 5</a>. Here's the newly enhanced loop which would also display the same result as above where we call it the <strong>FOR EACH LOOP</strong>.</p>
<pre class="brush: java; title: ; notranslate">
int[] total = {1,2,3,4,5};
for (int i : total) {
System.out.println(i);
}
</pre>
<p>Oh my what happened to the code? Why is Java 5 that simple? Not only does this help one to code easier, the length to type out a FOR LOOP has now been cut short with this new method of writing one. What it does is pretty simple. In lame man's term, it's <em><strong>For each value in total I will pass them to variable 'i' to print</strong></em>.</p>
<p><span style="text-decoration: underline;"><strong>Conclusion</strong></span></p>
<p>Java 5 really does wonders to programmers of the technology in this new era. Of course SCJP exam takers should now know about this.</p>
]]></content:encoded>
			<wfw:commentRss>http://techiedan.com/2009/10/27/cool-new-loop-in-java-5/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

