Why ArrayIndexOutOfBoundsException?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8996842/errors-with-string-split">Errors with string split</a>  </p>
</blockquote>



<p>Why this code does not work?</p>

<pre><code>String s = "0.1";
String[] sa = s.split(".");
System.out.println(sa[0] + "Hello " + sa[1]);
</code></pre>

<p>It gives the error as :</p>

<pre><code>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
    at com.test.A.main(A.java:8)
</code></pre>
