title: Difference between moving an Iterator forward with a for statement and a while statement
body: <p>When I use an Iterator of Object I use a <em>while loop</em> (as written in every book learning Java, as <strong>Thinking in Java</strong> of Bruce Eckel):</p>
  
  <pre><code>Iterator it=...
  
  while(it.hasNext()){
      //...
  }
  </code></pre>
  
  <p>but sometime i saw than instead somebody use the <em>for loop</em>:</p>
  
  <pre><code>Iterator it=...
  for (Iterator it=...; it.hasNext();){
      //...
  }
  </code></pre>
  
  <p>I don't' understand this choice: </p>
  
  <ul>
  <li>I use the <em>for loop</em> when I have a collection with ordinal sequence (as array) or with a special rule for the step (declared generally as a simple increment <code>counter++</code>). </li>
  <li>I use the <em>while loop</em> when the loop finishes with I have'nt this constraints but only a logic condition for exit.</li>
  </ul>
  
  <p>It's a question of style-coding without other cause or it exists some other logic (performance, for example) that I don't' know?</p>
  
  <p>Thanks for every feedback</p>