Ternary operator abbreviated

A, ternary operator type conversion rules:
  1. If two operands can not be converted, the conversion is not, the return value of type Object
  2, if the two operands are type specific expression (such as variables), the the normal to convert binary numbers, int type to type long, long type converted to float the like.
  3. If two operands are a number S, the other is the expression, and it is designated type T, then, if the number S in the range of T, then converted to type T; if T exceeds the type S range, it is converted to S T type.
  4. If both operands are direct digital amount, the return type of the greater range.

Guess you like

Origin www.cnblogs.com/yangrongkuan/p/12028496.html