title: When would a do-while loop be the better than a while-loop?
body: <p>This is a highly subjective question, so I'll be more specific. Is there any time that a do-while loop would be a better style of coding than a normal while-loop?</p>
  
  <p>e.g. </p>
  
  <pre><code>int count = 0;
  do {
     System.out.println("Welcome to Java");
     count++;
  } while (count &lt; 10);`
  </code></pre>
  
  <p>It doesn't seem to make sense to me to check the while condition after evaluating the do-statement (aka forcing the do statement to run at least once).</p>
  
  <p>For something simple like my above example, I would imagine that: </p>
  
  <pre><code>int count = 0; 
  while(count &lt; 10) { 
     System.out.println("Welcome to Java"); count++;
  }
  </code></pre>
  
  <p>would be generally considered to have been written in a better writing style.</p>
  
  <p>Can anyone provide me a working example of when a do-while loop would be considered the only/best option? Do you have a do-while loop in your code? What role does it play and why did you opt for the do-while loop?</p>
  
  <p>(I've got an inkling feeling that the do-while loop may be of use in coding games. Correct me, game developers, if I am wrong!)</p>