title: java conditional operator and different types
body: <p>I have two methods in the <code>Item</code> Class:</p>
  <pre><code>public void setValue(String v);
  public void setValue(Double v);
  </code></pre>
  <p>and I want to use <em>Conditional Operator</em> to <code>setVAlue</code> in another class:</p>
  <pre><code>String str = ...
  Double dbl = ...
  item.setValue((condition) ? str : dbl);
  </code></pre>
  <p>but compiler says:</p>
  <pre><code>cannot find symbol
  symbol  : method setValue(java.lang.Object&amp;java.io.Serializable&amp;java.lang.Comparable&lt;? extends java.lang.Object&amp;java.io.Serializable&amp;java.lang.Comparable&lt;?&gt;&gt;)
  </code></pre>
  <p>I think compiler uses the <em>nearest common superclass (super interface)</em> of Double and String as type of conditional Operator. but why?</p>