title: Iterator trouble using Java creating exceptions
body: <pre><code>String input from keyboard
  Vector&lt;String&gt; myVector = new Vector&lt;String&gt;(someArray.length);   //assume Vector is populated
  Iterator&lt;String&gt; itr = myVector.iterator();
  
  for loop begins
      while(itr.hasNext() &amp;&amp; itr.next().equals(input)){
         itr.remove();
      }
  
      ...
  
      while(itr.hasNext()    // is this the problem source?
       run more code  
  
  for loop ends
  </code></pre>
  
  <p>when the current element equals to a string <code>input</code>, i want to remove that element, otherwise continue iterating. i keep getting concurrent exceptions here.</p>
  
  <p>what else should i do? should i be moving my itr.next elsewhere?</p>
  
  <p><strong>QUESTION:  i want the logic such that if the current Vector element equals to target, i want it removed from the Vector. how can i do that?</strong></p>