Not able to copy into String array from object
<p>I have a problem in copying the data in array from object variable which is also a type String.</p>

<p>Can any one explain this </p>

<pre><code> String[] childRoot = null;
 int k = 1;
 System.out.println(" Name " + d.getName()); 
 childRoot[k]=d.getName();                         *
 k++;
</code></pre>

<p>output</p>

<pre><code>Name try 1
java.lang.NullPointerException
at *  
</code></pre>

<p>Detail for :getName</p>

<pre><code>  java.lang.String getName()
  Returns the name of this object 
</code></pre>
