title: Does an If-else boolean expression (&&) increment a variable outside the if-else statements even if one of the expressions are false?
body: <p>I am doing exercises in my Java Programming book and I came across this:</p>
  
  <p>Suppose that <code>x</code> is 1. What is <code>x</code> after the evaluation of the following expression?</p>
  
  <p><strong>A)</strong></p>
  
  <pre><code>(x &gt;= 1) &amp;&amp; (x++ &gt; 1)
  </code></pre>
  
  <p><strong>B)</strong></p>
  
  <pre><code>(x &gt; 1) &amp;&amp; (x++ &gt; 1)
  </code></pre>
  
  <p>I understand <strong>B)</strong> because it tests <code>(x &gt; 1)</code> first which is false, so it does not test <code>(x++ &gt; 1)</code> and therefore doesn't increment <code>x</code>.</p>
  
  <p>However, on <strong>A)</strong> <code>(x &gt;= 1)</code> is true so it goes to <code>(x++ &gt; 1)</code> to test it as well, but <code>(x++ &gt; 1)</code> is false. Does this mean that even though it's false, the variable <code>x = 1</code> is still being incremented because the expression <code>(x++ &gt; 1)</code> was executed?</p>