title: Java Arraylist remove multiple element by index
body: <p>Here is my code:</p>
  
  <pre><code>for (int i = 0; i &lt; myarraylist.size(); i++) {
          for (int j = 0; j &lt; stopwords.size(); j++) {
              if (stopwords.get(j).equals(myarraylist.get(i))) {
                  myarraylist.remove(i);
                  id.remove(i);
                  i--; // to look at the same index again!
              }
          }
      }
  </code></pre>
  
  <p>I have problem.. after element removed, all index always changed, the loop above so messy.</p>
  
  <p>To illustrate: 
  I have 54 data, but loop above become messy after element removed.. so only 50 data that checked.</p>
  
  <p>Is there another way or fix my code to <strong>remove multiple element by index</strong>??
  element index is so important to me, to remove another arraylist that have the same index.</p>