I recently came across a question that made me stop and think ...
For me, the code below should always cause an error, but when one of my colleagues asked me why Eclipse did not show it, I could not answer anything.
class A { public static void main(String... args) { System.out.println(new Object() == 0); } }
I researched and found that with an initial level of 1.6 it really throws an error:
incomparable types: Object and int
But now in 1.7 everything compiles fine.
Please, what new feature guarantees this behavior?
java eclipse java-7 compare autoboxing
rsalmei Aug 29 '13 at 0:00 2013-08-29 00:00
source share