<?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: How-To: Initialise arrays of objects in Java</title>
	<atom:link href="http://r3dux.org/2011/10/how-to-initialise-arrays-of-objects-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://r3dux.org/2011/10/how-to-initialise-arrays-of-objects-in-java/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-initialise-arrays-of-objects-in-java</link>
	<description>A number-pimping side project from the valleys in *NEW* upside-down flavour.</description>
	<lastBuildDate>Tue, 15 May 2012 23:01:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2011/10/how-to-initialise-arrays-of-objects-in-java/#comment-7045</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Thu, 20 Oct 2011 23:32:34 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5510#comment-7045</guid>
		<description>Hmm, never heard of a properties file - that seems pretty good, actually! Ta! =D</description>
		<content:encoded><![CDATA[<p>Hmm, never heard of a properties file &#8211; that seems pretty good, actually! Ta! =D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shetboy</title>
		<link>http://r3dux.org/2011/10/how-to-initialise-arrays-of-objects-in-java/#comment-7044</link>
		<dc:creator>shetboy</dc:creator>
		<pubDate>Thu, 20 Oct 2011 12:30:44 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5510#comment-7044</guid>
		<description>Thought that this may be of some use and is directly related to your code example, you could initialize arrays like this...

&lt;pre lang=&quot;java&quot;&gt;private Integer[] myNumbers = {
    new Integer(17),
    new Integer(22)
};&lt;/pre&gt;


But if you need to have a bunch of numbers initialized then logically speaking they &lt;i&gt;could&lt;/i&gt; be properties, this will depend on your design.  So I&#039;d initialise them with a &lt;a href=&quot;http://www.mkyong.com/java/java-properties-file-examples/&quot; rel=&quot;nofollow&quot;&gt;properties file&lt;/a&gt; instead of hard-code values within the class.

Or retrieve them from a database

Or you know, like... whateva

Your mileage may vary (YMMV!)</description>
		<content:encoded><![CDATA[<p>Thought that this may be of some use and is directly related to your code example, you could initialize arrays like this&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Integer</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> myNumbers <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Integer</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">17</span><span style="color: #009900;">&#41;</span>,
    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Integer</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">22</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>But if you need to have a bunch of numbers initialized then logically speaking they <i>could</i> be properties, this will depend on your design.  So I&#8217;d initialise them with a <a href="http://www.mkyong.com/java/java-properties-file-examples/">properties file</a> instead of hard-code values within the class.</p>
<p>Or retrieve them from a database</p>
<p>Or you know, like&#8230; whateva</p>
<p>Your mileage may vary (YMMV!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shetboy</title>
		<link>http://r3dux.org/2011/10/how-to-initialise-arrays-of-objects-in-java/#comment-7012</link>
		<dc:creator>shetboy</dc:creator>
		<pubDate>Fri, 07 Oct 2011 10:47:26 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5510#comment-7012</guid>
		<description>Basically, if you have a coding problem the chances are that somebody or some group will have written a library that solves it in a very re-usable and simple way.

A great example of this is &lt;a href=&quot;http://commons.apache.org/&quot; rel=&quot;nofollow&quot;&gt;Apache Commons&lt;/a&gt;, but remember that this is only one example.

That is why it&#039;s really important to setup &lt;a href=&quot;http://eclipse.org/m2e/&quot; rel=&quot;nofollow&quot;&gt;Maven Integration&lt;/a&gt; in your IDE.  Getting a specific version of a specific jar is simply a right-click-and-select-from-list away.  It&#039;s like &lt;a href=&quot;http://www.nongnu.org/synaptic/&quot; rel=&quot;nofollow&quot;&gt;Synaptic&lt;/a&gt; for Java because it&#039;ll get you all the jar&#039;s that depend on it too.</description>
		<content:encoded><![CDATA[<p>Basically, if you have a coding problem the chances are that somebody or some group will have written a library that solves it in a very re-usable and simple way.</p>
<p>A great example of this is <a href="http://commons.apache.org/">Apache Commons</a>, but remember that this is only one example.</p>
<p>That is why it&#8217;s really important to setup <a href="http://eclipse.org/m2e/">Maven Integration</a> in your IDE.  Getting a specific version of a specific jar is simply a right-click-and-select-from-list away.  It&#8217;s like <a href="http://www.nongnu.org/synaptic/">Synaptic</a> for Java because it&#8217;ll get you all the jar&#8217;s that depend on it too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2011/10/how-to-initialise-arrays-of-objects-in-java/#comment-7011</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Fri, 07 Oct 2011 08:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5510#comment-7011</guid>
		<description>Did not know about that class! (as I gather you gathered =P)

Will check it out - thanks, mate!

Also, liked your quote - but if you use &lt;blockquote&gt; you get a quote graphic (WOOOOooooo!)</description>
		<content:encoded><![CDATA[<p>Did not know about that class! (as I gather you gathered =P)</p>
<p>Will check it out &#8211; thanks, mate!</p>
<p>Also, liked your quote &#8211; but if you use &lt;blockquote&gt; you get a quote graphic (WOOOOooooo!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shetboy</title>
		<link>http://r3dux.org/2011/10/how-to-initialise-arrays-of-objects-in-java/#comment-7010</link>
		<dc:creator>shetboy</dc:creator>
		<pubDate>Fri, 07 Oct 2011 05:01:07 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=5510#comment-7010</guid>
		<description>Good post

Just knowing about the &lt;a href=&quot;http://download.oracle.com/javase/6/docs/api/java/util/Arrays.html&quot; rel=&quot;nofollow&quot;&gt;java.util.Arrays&lt;/a&gt; class could potentially save you massive amounts of time down the road.

First sentence of Javadoc&#039;s is...
&lt;i&gt;&quot;This class contains various methods for manipulating arrays (such as sorting and searching). This class also contains a static factory that allows arrays to be viewed as lists.&quot;&lt;/i&gt;</description>
		<content:encoded><![CDATA[<p>Good post</p>
<p>Just knowing about the <a href="http://download.oracle.com/javase/6/docs/api/java/util/Arrays.html">java.util.Arrays</a> class could potentially save you massive amounts of time down the road.</p>
<p>First sentence of Javadoc&#8217;s is&#8230;<br />
<i>&#8220;This class contains various methods for manipulating arrays (such as sorting and searching). This class also contains a static factory that allows arrays to be viewed as lists.&#8221;</i></p>
]]></content:encoded>
	</item>
</channel>
</rss>

