I really can\'get my head around why the following happens:
Double d = 0.0; System.out.println(d == 0); // is true System.out.println(d.equals(0)); // is false ?
When you perform
d == 0
this is upcast to
d == 0.0
however there are no upcasting rules for autoboxing and even if there were equals(Object) gives no hits that you want a Double instead of an Integer.