title: why split function behave like this in java?
body: <p>if I do 
  <br/>     </p>
  
  <pre><code>    String a = ""
      String b = a.split(" ")[0];
  </code></pre>
  
  <p>It is not giving ArrayIndexOutOfBoundException </p>
  
  <p>but when I do 
  <br/></p>
  
  <pre><code>    String a = " "
      String b = a.split(" ")[0];
  </code></pre>
  
  <p>It is giving me ArrayIndexOutOfBoundException </p>
  
  <p>again when I do</p>
  
  <pre><code>    String a = " abc"
      String b = a.split(" ")[0];
  </code></pre>
  
  <p>It is not giving me Exception 
  WHY SO?</p>