The compound assignment operators are +=, –=, *=, /=, %=, <<=, >>=, >>>=, &=, ^=, and |=.
The Java language specification says that the compound assignment E1 op= E2 is equivalent to the simple assignment E1 = (T) ((E1) op (E2)), where T is the type of E1, except that E1 is evaluated only once.
In other words, compound assignment expressions automatically cast the result of the computation they perform to the type of the variable on their left-hand side.
If the type of the result is identical to the type of the variable, the cast has no effect. If, however, the type of the result is wider than that of the variable, the compound assignment operator performs a silent narrowing primitive conversion.
Always be ware of a hidden cast when using these operators.