title: ArrayIndexOutOfBoundException and IndexOutOfBoundsException
body: <p>Here the Exception is IndexOutOfBoundsException:</p>
  
  <pre><code>public static void main(String[] args) {
      List&lt;Integer&gt; elements = new ArrayList&lt;&gt;();
       elements.add(10);
       int firstElmnt = elements.get(1);
       System.out.println(firstElmnt);
  }
  </code></pre>
  
  <p>But here the Exception is ArrayIndexOutOfBoundsException:</p>
  
  <pre><code>public static void main(String[] args) {
      List&lt;Integer&gt; elements = new ArrayList&lt;&gt;();
       elements.add(10);
       int firstElmnt = elements.get(-1);
       System.out.println(firstElmnt);
  }
  </code></pre>
  
  <p>Does that mean for negative numbers we get IndexOutOfBoundException?</p>