<?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: Convert ArrayList to Arrays in Java</title>
	<atom:link href="http://viralpatel.net/blogs/2009/06/convert-arraylist-to-arrays-in-java.html/feed" rel="self" type="application/rss+xml" />
	<link>http://viralpatel.net/blogs/2009/06/convert-arraylist-to-arrays-in-java.html</link>
	<description>Tutorials, Java, J2EE, Struts, AJAX, JavaScript, CSS, Web 2.0, MySQL, Articles</description>
	<lastBuildDate>Tue, 09 Mar 2010 14:08:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Hauke</title>
		<link>http://viralpatel.net/blogs/2009/06/convert-arraylist-to-arrays-in-java.html/comment-page-1#comment-9645</link>
		<dc:creator>Hauke</dc:creator>
		<pubDate>Sat, 04 Jul 2009 15:24:44 +0000</pubDate>
		<guid isPermaLink="false">http://viralpatel.net/blogs/?p=1481#comment-9645</guid>
		<description>If you use an array with the correct size within the toArray method, the result is returned within the provided array. If you use a &quot;new T[0]&quot; another array has to be created, that is thrown away after the type information is read.
So it is bad style to use &quot;new T[0]&quot;.</description>
		<content:encoded><![CDATA[<p>If you use an array with the correct size within the toArray method, the result is returned within the provided array. If you use a &#8220;new T[0]&#8221; another array has to be created, that is thrown away after the type information is read.<br />
So it is bad style to use &#8220;new T[0]&#8220;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://viralpatel.net/blogs/2009/06/convert-arraylist-to-arrays-in-java.html/comment-page-1#comment-9604</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 03 Jul 2009 11:56:59 +0000</pubDate>
		<guid isPermaLink="false">http://viralpatel.net/blogs/?p=1481#comment-9604</guid>
		<description>Thanks!
It was useful for me! :)</description>
		<content:encoded><![CDATA[<p>Thanks!<br />
It was useful for me! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moe Lavigne</title>
		<link>http://viralpatel.net/blogs/2009/06/convert-arraylist-to-arrays-in-java.html/comment-page-1#comment-9588</link>
		<dc:creator>Moe Lavigne</dc:creator>
		<pubDate>Fri, 03 Jul 2009 03:17:15 +0000</pubDate>
		<guid isPermaLink="false">http://viralpatel.net/blogs/?p=1481#comment-9588</guid>
		<description>Maybe the following comment would have been better:

This is also works: T[] countries = list.toArray(new T[0]); 

The \&quot;toArray\&quot; method automatically adjusts the size of the target array, but it must be initialized... I just use zero;</description>
		<content:encoded><![CDATA[<p>Maybe the following comment would have been better:</p>
<p>This is also works: T[] countries = list.toArray(new T[0]); </p>
<p>The \&quot;toArray\&quot; method automatically adjusts the size of the target array, but it must be initialized&#8230; I just use zero;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TinhTruong</title>
		<link>http://viralpatel.net/blogs/2009/06/convert-arraylist-to-arrays-in-java.html/comment-page-1#comment-9585</link>
		<dc:creator>TinhTruong</dc:creator>
		<pubDate>Fri, 03 Jul 2009 02:29:48 +0000</pubDate>
		<guid isPermaLink="false">http://viralpatel.net/blogs/?p=1481#comment-9585</guid>
		<description>You don&#039;t have to put the list.size() to the new array, just 0 is enough because it just uses the information about the type of the return array, not the size, so the following code will work:
T [] countries = list.toArray(new T[0]);</description>
		<content:encoded><![CDATA[<p>You don&#8217;t have to put the list.size() to the new array, just 0 is enough because it just uses the information about the type of the return array, not the size, so the following code will work:<br />
T [] countries = list.toArray(new T[0]);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moe Lavigne</title>
		<link>http://viralpatel.net/blogs/2009/06/convert-arraylist-to-arrays-in-java.html/comment-page-1#comment-9583</link>
		<dc:creator>Moe Lavigne</dc:creator>
		<pubDate>Fri, 03 Jul 2009 00:47:26 +0000</pubDate>
		<guid isPermaLink="false">http://viralpatel.net/blogs/?p=1481#comment-9583</guid>
		<description>String[] countries = new String[0];

List list = new ArrayList();    
 list.add(&quot;India&quot;);  
 list.add(&quot;Switzerland&quot;);  
 list.add(&quot;Italy&quot;);  
 list.add(&quot;France&quot;);

countries = list.toArray(countries);</description>
		<content:encoded><![CDATA[<p>String[] countries = new String[0];</p>
<p>List list = new ArrayList();<br />
 list.add(&#8220;India&#8221;);<br />
 list.add(&#8220;Switzerland&#8221;);<br />
 list.add(&#8220;Italy&#8221;);<br />
 list.add(&#8220;France&#8221;);</p>
<p>countries = list.toArray(countries);</p>
]]></content:encoded>
	</item>
</channel>
</rss>
