Operator Shortcuts

Operator Shortcuts

Shortcut Operator Equivalent To

x++, ++x                  x = x + 1

x--, --x                     x = x – 1

x += y                      x = x + y

x -= y                       x = x - y

x *= y                       x = x * y

x /= y                       x = x / y

x %= y                     x = x % y

x >>= y                    x = x >> y

x <<= y                    x = x << y

x &= y                      x = x & y

x |= y                       x = x | y

x ^= y                      x = x ^ y

Ebook Download
View all
Learn
View all