 <pre><code>String a[]=null; </code></pre> <p><code>null</code> assigned before processing, so <code>NullPointerException</code>!</p> <p>try</p> <pre><code>String[] a=new String[100]; </code></pre> <p>or something;</p>