title: For what value of i does while (i == i + 1) {} loop forever?
body: <p><a href="http://homepages.inf.ed.ac.uk/perdita/inf1opadvanced2015.pdf" rel="noreferrer">I ran cross this puzzler from an advanced programming course at a UK university exam</a>.</p>
  
  <p>Consider the following loop, in which i is, so far, undeclared:</p>
  
  <pre><code>while (i == i + 1) {}
  </code></pre>
  
  <p>Find the definition of <code>i</code>, that precedes this loop, <em>such that the while loop
  continues for ever.</em></p>
  
  <p>The next question, which asked the same question for this code snippet:</p>
  
  <pre><code>while (i != i) {}
  </code></pre>
  
  <p>was obvious to me. Of course in this other situation it is <code>NaN</code> but I am really stuck on the prior one. Does this have to do with overflow? What would cause such a loop to loop for ever in Java?</p>