title: Java IndexOutOfBoundsException
body: <p>I made an little shoot em up game..It works normal but I want also implement if fires  intersects they will disappear. I have two list for Player bullets and for computer bullets ...But if I have more bullets from computer or reverse .Here my loop </p>
  
  <pre><code>     for (int i = 0; i &lt; cb.size(); i++) {
          for (int j = 0; j &lt; b.size(); j++) {
              if (b.get(j).rect.intersects(cb.get(i).rect)) {
  
                  cb.remove(i);
                  b.remove(j);
  
  
                  continue;
  
              }
              if (cb.get(i).rect.intersects(b.get(j).rect)) {
  
  
                  b.remove(j);
                  cb.remove(i);
  
                  continue;
  
              }
  
          }
  
      }
  </code></pre>
  
  <p>This is my game which woking algoritms...
  <a href="http://rapidshare.com/files/364597095/ShooterGame.2.6.0.jar" rel="nofollow noreferrer">http://rapidshare.com/files/364597095/ShooterGame.2.6.0.jar</a></p>