<?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: For Each Loop in Java 5</title>
	<atom:link href="http://www.myhomepageindia.com/index.php/2009/07/03/for-each-loop-in-java-5.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.myhomepageindia.com/index.php/2009/07/03/for-each-loop-in-java-5.html</link>
	<description>Travel Articles and Tech Notes</description>
	<lastBuildDate>Tue, 10 Aug 2010 23:11:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: OHaleck</title>
		<link>http://www.myhomepageindia.com/index.php/2009/07/03/for-each-loop-in-java-5.html/comment-page-1#comment-221</link>
		<dc:creator>OHaleck</dc:creator>
		<pubDate>Tue, 07 Jul 2009 06:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.myhomepageindia.com/?p=865#comment-221</guid>
		<description>&quot;This for loop has removed the iterator...&quot; - the iterator is not called explicitly, but it is still used inside the foreach loop.</description>
		<content:encoded><![CDATA[<p>&#8220;This for loop has removed the iterator&#8230;&#8221; &#8211; the iterator is not called explicitly, but it is still used inside the foreach loop.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OHaleck</title>
		<link>http://www.myhomepageindia.com/index.php/2009/07/03/for-each-loop-in-java-5.html/comment-page-1#comment-220</link>
		<dc:creator>OHaleck</dc:creator>
		<pubDate>Tue, 07 Jul 2009 06:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.myhomepageindia.com/?p=865#comment-220</guid>
		<description>Don&#039;t forget you sometimes just need Iterator in order to do modifications (e.g. delete elements) during the iteration. The Iterator interface supports generics so you can use a nicer version of it without having to cast:

public class GoodForLoop {  
  public static void main(String[] args) {  
    List list = new ArrayList(2);  
    list.add(&quot;First&quot;);  
    list.add(&quot;Second&quot;);  
    String str = null;  
    for(Iterator itr = list.iterator(); itr.hasNext();){  
      str = itr.next();  
      System.out.println(str);  
    }  
  }  
}  

Also, the first example can be modified to use generics and, since Java has nothing that allows one to iterate over two collections at a time, the &quot;classic&quot; version of the loop must be used to do so.</description>
		<content:encoded><![CDATA[<p>Don&#8217;t forget you sometimes just need Iterator in order to do modifications (e.g. delete elements) during the iteration. The Iterator interface supports generics so you can use a nicer version of it without having to cast:</p>
<p>public class GoodForLoop {<br />
  public static void main(String[] args) {<br />
    List list = new ArrayList(2);<br />
    list.add(&#8220;First&#8221;);<br />
    list.add(&#8220;Second&#8221;);<br />
    String str = null;<br />
    for(Iterator itr = list.iterator(); itr.hasNext();){<br />
      str = itr.next();<br />
      System.out.println(str);<br />
    }<br />
  }<br />
}  </p>
<p>Also, the first example can be modified to use generics and, since Java has nothing that allows one to iterate over two collections at a time, the &#8220;classic&#8221; version of the loop must be used to do so.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->