Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
boolean b = (3 == (Object)null); compiles because javac performs a boxing conversion followed by a widening reference conversion. This isn't currently a valid combination under casting conversion (as required by 15.21.3) but 6526446 will expand casting conversion and it will become valid. However, this does not compile, and should: boolean b = ((Object)null == 3); // incomparable types: java.lang.Object and int
|