<?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: I need help with this java  programming question?</title>
	<atom:link href="http://www.astronomag.com/solarsystem/i-need-help-with-this-java-programming-question/feed" rel="self" type="application/rss+xml" />
	<link>http://www.astronomag.com/solarsystem/i-need-help-with-this-java-programming-question</link>
	<description></description>
	<lastBuildDate>Mon, 19 Apr 2010 04:20:59 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nathanael H</title>
		<link>http://www.astronomag.com/solarsystem/i-need-help-with-this-java-programming-question/comment-page-1#comment-5817</link>
		<dc:creator>Nathanael H</dc:creator>
		<pubDate>Fri, 26 Feb 2010 21:12:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.astronomag.com/solarsystem/i-need-help-with-this-java-programming-question#comment-5817</guid>
		<description>ArrayLists can contain any object type, as well as a mixture of object types.  As such, populating the ArrayList is easy:

ArrayList solarSystem = new ArrayList();
//create a PlanetS object for Venus
solarSystem.add(/*name of PlanetS object*/);
//create a PlanetS object for Mercury
solarSystem.add(/*name of PlanetS object*/);
//etc etc...

The complexity comes when you want to get data out of the ArrayList, as you will have to cast it to the correct type:

PlanetS p = (PlanetS) solarSystem.get(1);&lt;br&gt;&lt;b&gt;References : &lt;/b&gt;&lt;br&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html</description>
		<content:encoded><![CDATA[<p>ArrayLists can contain any object type, as well as a mixture of object types.  As such, populating the ArrayList is easy:</p>
<p>ArrayList solarSystem = new ArrayList();<br />
//create a PlanetS object for Venus<br />
solarSystem.add(/*name of PlanetS object*/);<br />
//create a PlanetS object for Mercury<br />
solarSystem.add(/*name of PlanetS object*/);<br />
//etc etc&#8230;</p>
<p>The complexity comes when you want to get data out of the ArrayList, as you will have to cast it to the correct type:</p>
<p>PlanetS p = (PlanetS) solarSystem.get(1);<br /><b>References : </b><br /><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html" rel="nofollow">http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
