Booleans, conditional operators and autoboxing
The difference is that the explicit type of the returnsNull() method affects the static typing of the expressions at compile time: E1: `true ? returnsNull() : false` – boolean (auto-unboxing 2nd operand to boolean) E2: `true ? null : false` – Boolean (autoboxing of 3rd operand to Boolean) See Java Language Specification, section 15.25 Conditional … Read more