JLS: <a href="https:&#x2F;&#x2F;docs.oracle.com&#x2F;javase&#x2F;specs&#x2F;jls&#x2F;se7&#x2F;html&#x2F;jls-15.html#jls-15.25" rel="nofollow">https:&#x2F;&#x2F;docs.oracle.com&#x2F;javase&#x2F;specs&#x2F;jls&#x2F;se7&#x2F;html&#x2F;jls-15.htm...</a><p>Otherwise, if the second and third operands have types that are convertible (§5.1.8) to numeric types, then there are several cases:<p>... binary numeric promotion (§5.6.2) is applied to the operand types, and the type of the conditional expression is the promoted type of the second and third operands.<p>... If either operand is of type double, the other is converted to double.