The basic assignment operator is the equal sign, which assigns the value (literal or variable) on
its right to the variable on its left.
The assignment operator can also be combined with a variety of other operators to provide
shorthand versions of standard operations.
x = a;
a += b instead of a = a + b
a -= b instead of a = a - b
a *= b instead of a = a * b
a /= b instead of a = a / b
a %= b instead of a = a % b
Assignment operator combines with the arithmetic operators +, -, *, / and % to give the above shorthand versions
a <<= b instead of a = a << b
a >>= b instead of a = a >> b
a >>>= b instead of a = a >>> b
a &= b instead of a = a & b
a ^= b instead of a = a ^ b
a |= b instead of a = a | b
It also combines with the above bitwise operators
NOTE:
If the operand to the left of the equal sign itself contains an assignment operator, then the
above shorthand statements won't work. Instead you must use the longer version of the
statement.