Not able to remove from an ArrayList
<pre><code> import java.util;  
 class Driver{

 public static void main(String[] args) {
      ArrayList&lt;String&gt; lstStr = new ArrayList&lt;String&gt;();
      lsstStr.add("A");
      lsstStr.add("B");
      lsstStr.add("C");
      for(Iterator&lt;String&gt; it = lstStr.Iterator(); it.hasNext();)
      {
          str = it.next();
          if(str.equals("B")){lstStr.remove(str);}
      }
      for(Iterator&lt;String&gt; it = lstStr.Iterator(); it.hasNext();)
      {
        System.out.println(it.next());
      }
 }
 }
</code></pre>

<p>This is not removing "B" from the list. Why Str is not equal to "B" when loop runs second time.Why?</p>
