<?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>SCJP Certification &#187; collections</title>
	<atom:link href="http://www.scjp-certification.com/tag/collections/feed" rel="self" type="application/rss+xml" />
	<link>http://www.scjp-certification.com</link>
	<description>Sun Certified Java Programmer Certification exam essentials</description>
	<lastBuildDate>Fri, 30 Sep 2011 05:54:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>What is the for-each loop?</title>
		<link>http://www.scjp-certification.com/what-is-the-for-each-loop.html</link>
		<comments>http://www.scjp-certification.com/what-is-the-for-each-loop.html#comments</comments>
		<pubDate>Wed, 07 Oct 2009 03:54:10 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[collections]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[for-each]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=282</guid>
		<description><![CDATA[A for-each loop is an enhanced for loop. It is used to iterate over arrays and collections. This feature was...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-the-for-each-loop.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-the-for-each-loop.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>A for-each loop is an enhanced for loop. It is used to iterate over arrays and collections. This feature was added to Java to make the access and retrieval of elements of arrays and collections faster. The syntax of a for-each loop is as follows:</p>
<p>for(type itrvar: collection)<br />
{</p>
<p>}</p>
<p>where, itrvar is the variable that iterates through the elements of the collection.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-the-for-each-loop.html&amp;title=What%20is%20the%20for-each%20loop%3F"><img src="http://www.scjp-certification.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.scjp-certification.com/what-is-the-for-each-loop.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is the comparable interface?</title>
		<link>http://www.scjp-certification.com/what-is-the-comparable-interface.html</link>
		<comments>http://www.scjp-certification.com/what-is-the-comparable-interface.html#comments</comments>
		<pubDate>Fri, 25 Sep 2009 12:08:54 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[collections]]></category>
		<category><![CDATA[comparable interface]]></category>
		<category><![CDATA[compareTo()]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=261</guid>
		<description><![CDATA[The Comparable interface is used to sort collections and arrays of objects using the Collections.sort() and java.utils.Arrays.sort() methods respectively. The...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-the-comparable-interface.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-the-comparable-interface.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The Comparable interface is used to sort collections and arrays of objects using the Collections.sort() and java.utils.Arrays.sort() methods respectively. The objects of the class implementing the Comparable interface can be ordered.</p>
<p>The Comparable interface in the generic form is written as follows:</p>
<p><strong>interface Comparable<T></strong>, where T is the name of the type parameter.</p>
<p>All classes implementing the Comparable interface must implement the compareTo() method that has the return type as an integer. The signature of the compareTo() method is as follows</p>
<p><strong>int i = object1.compareTo(object2)</strong></p>
<ul>
<li>If object1 < object2: The value of i returned will be negative.</li>
<li> If object1 > object2: The value of i returned will be positive. </li>
<li> If object1 = object2: The value of i returned will be zero.</li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-the-comparable-interface.html&amp;title=What%20is%20the%20comparable%20interface%3F"><img src="http://www.scjp-certification.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.scjp-certification.com/what-is-the-comparable-interface.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

