title: Ternary operator in Java only evaluating one expression since Java 7 - was that different in Java 1.6 and lower?
body: <p>Preparing for the Oracle Certified Associate Java SE 8 Programmer 1 exam, I came across the following paragraph about the ternary expression in the official Study Guide:</p>
  
  <blockquote>
    <p><strong>Ternary Expression Evaluation</strong>
    <br/>
    As of Java 7, only one of the right-hand expressions of the ternary operator will be evaluated at runtime. In a manner similar to the short-circuit operators, if one of the two right-hand expressions in a ternary operator performs a side effect, then it may not be applied at runtime. Let's illustrate this principle with the following example: [...]</p>
  </blockquote>
  
  <p>It says that only one of the two expressions is evaluated, demonstrating with the following example:</p>
  
  <pre><code>int y = 1;
  int z = 1;
  int a = y &lt; 10 ? y++ : z++;
  </code></pre>
  
  <p>Here, only <code>y</code> increments, but <code>z</code> does not, as you would expect.</p>
  
  <p>What I am stumbling across is the beginning of the paragraph (marked in yellow) where it says "As of Java 7, ...". I tested the same code with Java 1.6 and I can't find a difference in the behavior. I expected Java 1.6 to evaluate both expressions just from the information given in the paragraph. Does anyone have an idea what they wanted to say with "As of Java 7,  ..."?</p>
  
  <p><strong>Edit:</strong> To avoid confusion: It boils down to the question, Since they write 'As of Java 7', was there anything that changed concerning the ternary operator, when switching from Java 6 to Java 7?</p>