title: How numeric promotion in a conditional assignment works in Java
body: <p>Found some strange things in java.</p>
  
  <p>Code:</p>
  
  <pre><code>    System.out.println(System.getProperty("java.version"));
      System.out.println((true) ? (int)2.5 : 3.5);
      System.out.println((true) ? (int)2.5 : 3);
      System.out.println((true) ? (int)2.5 + "" : 3.5);
  </code></pre>
  
  <p>Result:</p>
  
  <pre>
  1.8.0_40
  2.0
  2
  2
  </pre>
  
  <p>What is it? Why integer value returns only if value for false is not a double or if string value added to value for true? Is it a bug?</p>