title: 101 java Array index out of bounds error on code for reading objects into array
body: <p>I have this code, and I keep getting an array index out of bounds error. I really do not know why. Can anyone please explain me why?</p>
  <pre><code>        String[] splitter= entry.split(&quot; &quot;);
       
          String name = &quot;&quot;;
          String burialDate = &quot;&quot;;
          String age = &quot;&quot;;
  
          for(int i = 0; i &lt; entry.length(); i++)
          {
              if(splitter[i].equals(&quot;&quot;))
              {
                  if((splitter[i].charAt(0) &lt;= '9' &amp;&amp; splitter[i].charAt(0) &gt;= '0'))
                  {
                      int index = i;
                      break;
                  }
  
                  else
                      name = name + splitter[i] + &quot; &quot;;
              }
          }
          name = name.substring(0, name.length()-1);
          burialDate = splitter[index] + &quot; &quot; + splitter[index+1] + &quot; &quot; + splitter[index+2];
          age = splitter[index+1];
  
          Person person = new Person(name, burialDate, age);
  
          return person;
  </code></pre>