Java conditional operator ?: result type
The difference is static typing of the expressions at compile time: Summary E1: `(false ? 1.0f : null)` – arg 2 ‘1.0f’ : type float, – arg 3 ‘null’ : type null – therefore operator ?: : type Float (see explanation below) – therefore autobox arg2 – therefore autobox arg3 E2: `(false ? 1.0f : … Read more