How to get an objects string and add this to a string array
<p>I have an <code>ArrayList</code> of my own class <code>Case</code>. The class case provides the method <code>getCaseNumber()</code> I want to add all of the cases casenumber to a <code>String[] caseNumber</code>. I've tried this</p>

<pre><code>public String[] getCaseNumberToTempList(ArrayList&lt;Case&gt; caseList) {

    String[] objectCaseNumber = null; 

    for(int i = 0; i &lt; caseList.size(); i++) {
        objectCaseNumber[i] = caseList.get(i).getCaseNumber();  
    }

    return objectCaseNumber;

}
</code></pre>

<p>But my compiler complaints about that the <code>objectCaseNumber</code> is null at the point insid the for-loop. How can I manage to complete this? </p>
