title: Can't add to an array list
body: <p>I have the oddest problem, probably with a simple solution.</p>
  
  <p>I have created and initialized a list and then proceeded to create 4 objects of the list's type. In the constructor of these they place themselves in the list. Or at least are supposed to. I always get an out of bound exception and I cant figure out why. I set the list to have a size of 402 (for all possible VK values) but in the console and debug it always says it has size 0, no matter how large or empty I set it too....</p>
  
  <pre><code>public class InputHandler implements KeyListener
  {
  
  public static List&lt;Key&gt; keyList = new ArrayList&lt;Key&gt;(KeyEvent.KEY_LAST);
  
  public Key up = new Key(KeyEvent.VK_UP);
  public Key down = new Key(KeyEvent.VK_DOWN);
  public Key left = new Key(KeyEvent.VK_LEFT);
  public Key right = new Key(KeyEvent.VK_RIGHT);
  
  
  public class Key
      {
  
      public int keyCode;
  
      public Key(int defaultCode)
      {
          this.keyCode = defaultCode;
          keyList.add(keyCode,this);
      }
  
      public Key reMapKey(int newKey)
      {
          keyList.remove(keyCode);
          keyList.set(newKey, this);
          this.keyCode = newKey;
          return this;
      }
  
  }
  
  }
  </code></pre>
  
  <p>There is more to the code but I attempted to SSCCE it.</p>
  
  <p>The only info of value from the console is this:</p>
  
  <pre><code>Exception in thread "RogueLoveMainThread" java.lang.IndexOutOfBoundsException: Index: 38, Size: 0
  </code></pre>
  
  <p>Much apologies for my stupidity</p>