Normal
Nach langspec-3.0 para 15.25 sind beide Wertoperanden gleichwertig. Der Fall wird dort wie folgt beschrieben:"Otherwise, the second and third operands are of types S1 and S2 respectively. Let T1 be the type that results from applying boxing conversion to S1, and let T2 be the type that results from applying boxing conversion to S2. The type of the conditional expression is the result of applying capture conversion (§5.1.10) to lub(T1, T2) (§15.12.2.7)."Für false?1.0f:null ist also T1 Float (nach boxing) und T2 der Nulltyp. Was ist dann lub(T1,T2)? Float? Der Nulltyp? Object?false?1.0f:null evaluiert zu null. Wieso ergibt dann false?1.0ffalse?1.0f:null) nicht auch null?
Nach langspec-3.0 para 15.25 sind beide Wertoperanden gleichwertig. Der Fall wird dort wie folgt beschrieben:
"Otherwise, the second and third operands are of types S1 and S2 respectively. Let T1 be the type that results from applying boxing conversion to S1, and let T2 be the type that results from applying boxing conversion to S2. The type of the conditional expression is the result of applying capture conversion (§5.1.10) to lub(T1, T2) (§15.12.2.7)."
Für false?1.0f:null ist also T1 Float (nach boxing) und T2 der Nulltyp. Was ist dann lub(T1,T2)? Float? Der Nulltyp? Object?
false?1.0f:null evaluiert zu null. Wieso ergibt dann false?1.0ffalse?1.0f:null) nicht auch null?