It`s because, those expressions are similar but not exactly this same. When you use ‘+=’
java will cast the expression automatically so when you write:
The compiler will see something like this:
P.S I suggest you K&B book, you will find there many answers which will appear for sure, while you are learning for
SCJP ^^