title: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds
body: <p>The Line Try is Showing Red and :</p>
  <blockquote>
  <p>Exception in thread &quot;main&quot; java.lang.ArrayIndexOutOfBoundsException:
  Index 2 out of bounds for length 2    at
  skipcounting.Skipcounting.main(MyJava.java:11)</p>
  </blockquote>
  <pre class="lang-java prettyprint-override"><code>package skipcounting;
  
  public class Skipcounting {
    public static void main(String[] args) {
      try {
        int[][] numbers = {{1, 2, 3, 4, 5}, {10, 20, 30, 40, 50}};
        for (int i = 0; i &lt; numbers[1].length; i++) {
          for (int j = 0; j &lt; numbers[1].length; j++) {
            System.out.println(&quot;numbers[&quot; + i + &quot;][&quot; + j + &quot;]=&quot; + numbers[i][j]);
          }
        }
      }
    }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/wVpS8.png" rel="nofollow noreferrer">Error Shown</a></p>