Bitwise operators, string concatenation operator

| Bitwise or: Bitwise OR operator "|" is the binary operators. Its function is involved in computing two binary numbers each corresponding phase, or. As long as the corresponding two binary bit is a 1, it is a result bit.

Bitwise AND &: Bitwise AND operator "&" is a binary operator. Its function is involved in computing the phase of two binary numbers each corresponding to the. Only two corresponding binary bits are 1, the result was only 1 bit.

^ Bitwise XOR: 1 is different, is not different from zero.

Left-shift operator <<: binary to the left, its right vacated bit 0 by padding, by the equivalent of 2;
The two left = 5 5 2 2 = 20.

">>" right shift operator: binary to the right by 2 equivalent; assuming x = 5, then x is a binary 0101, x >> 1 represents a right x, i.e., the rightmost bit Deletion 1, becomes 010, when x = 2.

"+" String concatenation operator: operator side on both sides of the operator as long as a string to a string type connector,
such as a = "3", b = 4, c = 5, a + b = 34, b + c = 9.

Released four original articles · won praise 0 · Views 45

Guess you like

Origin blog.csdn.net/Pu1eya/article/details/104102858