Can someone explain this java.lang.ArrayIndexOutOfBoundsException to me : <p>Here's my code:</p>

<pre><code>import java.util.Arrays;

public class TwelveInts {

    public static void main(String[] args) {

        int bucky[]={1,2,3,4,5,6,7,8,9,10,11,12};
        System.out.println("First to last: ");
        for(int i = 0; i&lt;bucky.length; i++){
            System.out.print(bucky[i] + " ");
        }
        System.out.println("");

        System.out.println("Opposite order :) ");
        **for(int i = bucky.length; i &gt;=0; i--){**
            System.out.print(bucky[i] + " ");
        }


    }

}
</code></pre>

<p>I realize that the line of problematic code is this:</p>

<pre><code>for(int i = bucky.length; i &gt;=0; i--)
</code></pre>

<p>It should be written as follows to get rid of the exception:</p>

<pre><code>for(int i = bucky.length - 1; i &gt;=0; i--){
</code></pre>

<p>I just don't understand why though. I know that the reason is because it's due to an illegal index, but I just don't understand this exception error in application to this problem. If someone can help me understand why this exception occurs in this problem without the "<strong>-1"</strong>, that would be great. I'm just having a really hard time visualizing it for this. </p>
