Operator Example Result
= x = 5; x is 5.
+= x = 1; x is 6.
x += 5;
-= x = 1; x is -4.
x -= 5;
*= x = 1; x is 5.
x *= 5;
/= int x = 1; x is 0.
x /= 5;
%= x = 1; x is 1.
x %= 5;
&= x = 1; x is 1.
x &= 5;
|= x = 1; x is 5.
x |= 5;
^= x = 1; x is 4.
x ^= 5;
<<= x = 1; x is 32.
x <<= 5;
>>= x = 1; x is 0.
x >>= 5;
>>>= x = 1; x is 0.
x >>>= 5;
x = y The variable x is assigned the value of y.
x += y The variable x is assigned the value of x + y.
x -= y The variable x is assigned the value of x - y.
x *= y The variable x is assigned the value of x * y.
x /= y The variable x is assigned the value of x / y.
x %= y The variable x is assigned the value of x % y.
x &= y The variable x is assigned the value of x & y.
x |= y The variable x is assigned the value of x | y.
x ^= y The variable x is assigned the value of x ^ y.
x <<= y The variable x is assigned the value of x <<= y.
x >>= y The variable x is assigned the value of x >>= y.
x >>>= y The variable x is assigned the value of x >>>= y.
|