title: Arraylist not able to remove duplicate strings
body: <pre><code>public static void main(String[] args) {
         List&lt;String&gt; list = new ArrayList();
         list.add("AA");list.add("Aw");list.add("Aw");list.add("AA");
         list.add("AA");list.add("A45");list.add("AA");
         list.add("Aal");list.add("Af");list.add("An");
  
         System.out.println(list);
  
         for(int i=0;i&lt;list.size();i++){
            if(list.get(i).equals("AA")){
               list.remove(i);
            }
         }
  
         System.out.println(list);
  }
  </code></pre>
  
  <p>I am currently attempting to remove all the elements within the ArrayList that have the value of <code>"AA"</code>, However, it's only removing some of them and not all. can anyone explain to me what am I doing wrong?</p>
  
  <p>elements within arraylist:</p>
  
  <pre><code>[AA, Aw, Aw, AA, AA, A45, AA, Aal, Af, An]
  </code></pre>
  
  <p>output after i've attempted to remove all the strings that have the value of <code>"AA"</code>.</p>
  
  <pre><code>[Aw, Aw, AA, A45, Aal, Af, An]
  </code></pre>
  
  <p>why still <code>AA</code> is within the output list?</p>