title: In Java, when is a "do while" loop the only option?
body: <p>Is there ever a situation where you <em>must</em> use a <code>do while</code> loop?  Is it an accepted practice? It seems like it is equivalent to a plain <code>while</code> loop except that its first iteration happens before checking the conditional, if that is even true.</p>
  
  <pre><code>int i = 3;
  while ( i &gt; 0 ) {  // runs 3 times
      i--;
  }
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>int j = 3;
  do {
      j --;
  } while ( j &gt; 0 ); // runs 3 times
  </code></pre>
  
  <p>The same?</p>
  
  <p>EDIT:  I have seen the java doc, but
  the example in the java docs doesn't look like it requires that the particular routine inside of the do while loop must be run in the do while loop instead of inside of a regular while loop!</p>