<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Array of objects initialization Problem' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Array of objects initialization Problem' posted on the 'Java' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 22:54:29 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 22:54:29 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Array of objects initialization Problem</title>
      <link>http://www.programmersheaven.com/mb/java/368237/368237/array-of-objects-initialization-problem/</link>
      <description>As Array of primative data types or non premative data types( objects of class) are created, they are initialized.i.e.&lt;br /&gt;
if i do&lt;br /&gt;
int [] i = new int [10]; then,&lt;br /&gt;
Array of 10 integers is created and they are initializesd by zero and if i have a class of Name Test and i do&lt;br /&gt;
Name [] N = new Name[10]; then&lt;br /&gt;
10 Array of data type Name is created and they all iniatialized by null and if i call any method of Name like N[0].someMethod then JDK sends nullpointerexception.&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: Purple;"&gt;Please tell me how to over come to this problem and how array of data types are created by their Actual object not by null or 0 value.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/java/368237/368237/array-of-objects-initialization-problem/</guid>
      <pubDate>Sat, 22 Dec 2007 09:13:39 -0700</pubDate>
      <category>Java</category>
    </item>
    <item>
      <title>Re: Array of objects initialization Problem</title>
      <link>http://www.programmersheaven.com/mb/java/368237/368241/re-array-of-objects-initialization-problem/#368241</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I think the best you can do is write a loop that initializes each element of the array after you've declared it.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;for (i = 0; i &amp;lt; TheArray.Length; i++)
    TheArray[i] = new Thingy();&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Or something like that; it may be a little off, since (happily &lt;img src="http://www.programmersheaven.com/images/Community/smile.gif" width="15" height="15" alt="" /&gt;) I don't have to write Java any more these days. &lt;img src="http://www.programmersheaven.com/images/Community/smile.gif" width="15" height="15" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
Jonathan&lt;br /&gt;
###&lt;br /&gt;
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&amp;amp;&amp;amp;&lt;br /&gt;
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;&lt;br /&gt;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/java/368237/368241/re-array-of-objects-initialization-problem/#368241</guid>
      <pubDate>Sun, 23 Dec 2007 08:45:43 -0700</pubDate>
      <category>Java</category>
    </item>
  </channel>
</rss>