Possible Duplicate:
Java += operator
Code example:
double d = 1;
float f = 2;
f += d; // no error?
f = f+d; // type mismatch error, should be f = (float) (f+d);
So why does f+=d not produce an error (not even at runtime), although this would decrease the accuracy of d?
The compount assignment does an implicit cast.
is equivalent to
Another example