NullPointerException in for loop?
<p>I know why there is an error and i have fixed it.. i need someone to explain it properly.. It compiles fine but at runTime it shows Null Pointer Exception at line <strong>appString[i][j] = s[j];</strong>..Some one know the reason...?</p>

<pre><code>appString = new String[app.size()][];
for(int i = 0; i&lt;app.size();i++)
{
    Vector appVec = (Vector) app.get(i);
    String[] s = new String[appVec.size()];
    appVec.toArray(s);
    for(int j = 0 ; j&lt;s.length;j++)
    {
        //String s1 = s[j];
        appString[i][j] = s[j];
    }
}
</code></pre>
