title: Java Changing For to While
body: <p>I would like to change this for loop to a while statement:</p>
  
  <pre><code>for (int x = 0; x &lt; items.size(); x++) {...}
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>int x = 0;
  while(x&lt;items.size()){
  x++;
  ...
  }
  </code></pre>
  
  <p>but it won't work.</p>