Paweł Baczyński wrote:
Tim Harris wrote: methodOfA will ALWAYS return null
No, this method will always throw NullPointerException because it tries to unbox null value.
Whoops, you are indeed correct.
If you were to try my example code in Eclipse, it would tell you that it cannot convert a null to int - in the given example, it's being boxed inside the expression, so it sneaks past the compiler.