title: java.lang.ArrayIndexOutOfBoundsException: 2 >= 0
body: <p>I am working on a project and getting this error " java.lang.ArrayIndexOutOfBoundsException: 2 >= 0" 
  I've problem related to this, I know that this is ArrayIndexOutOfBoundsException :P but 
  taking look at this sample example,</p>
  
  <pre><code>import java.awt.List;
  import java.util.ArrayList;
  
  
  public class Oube {
      public static void main(String[] args) {
  
           ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
  
           list.add("Hello");
           list.add("World");
           list.add("World");
  
           System.out.println(list.size());
           System.out.println(list.get(0));
           System.out.println(list.get(1));
           System.out.println(list.get(2));
           System.out.println(list.get(3));
           System.out.println(list.get(4));
           System.out.println(list.get(5));
           System.out.println(list.get(6));
      }
  }
  </code></pre>
  
  <p>we get following error,
  Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 3, Size: 3</p>
  
  <p>Here we don't see anything like, x&lt;=y</p>
  
  <p>and in my code, i amg etting 2>=0 error after ArrayIndexOutOfBoundsException
  So my problem is that, when do we get such 2 >= 0 like errors ?</p>