title: Why is my int[] array loop out of bounds?
body: <p><strong>Warning:</strong> <em>I am very new to Java and programming in general. I'll try to be as clear as possible.</em></p>
  
  <p>I am attempting to take a simple integer (<code>inputnumber</code>), convert it to a string (<code>temp</code>), create a new int[] array (<code>numberarray</code>), and loop through this int[] array, starting from the last digit, and print out the name of the digit. </p>
  
  <p>I am rather sure that the conversion from integer to String to int[] array was functional due to Eclipse debugging, but am stumped as to why I am getting an ArrayOutOfBounds message from Eclipse for such a simple for loop. Any clues as to what I am doing wrong is appreciated. </p>
  
  <pre><code>    String temp = inputnumber.toString();
      int[] numberarray = new int[temp.length()];
  
      for (int i=0;i&lt;temp.length();i++) {
          numberarray[i] = temp.charAt(i);
      }
  
  
      for (int i=temp.length();i&gt;0;i--) {
  
          if (numberarray[i]==1) System.out.print("one.");
          if (numberarray[i]==2) System.out.print("two.");
          if (numberarray[i]==3) System.out.print("three.");
          if (numberarray[i]==4) System.out.print("four.");
          if (numberarray[i]==5) System.out.print("five.");
          if (numberarray[i]==6) System.out.print("six.");
          if (numberarray[i]==7) System.out.print("seven.");
          if (numberarray[i]==8) System.out.print("eight.");
          if (numberarray[i]==9) System.out.print("nine.");
          if (numberarray[i]==0) System.out.print("zero");
      }
  </code></pre>
  
  <p>The Eclipse error message I am getting is:</p>
  
  <pre><code>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
  at jt.Intermediate8.main(Intermediate8.java:44)
  </code></pre>