1184 Java Utilities Package and Bit Manipulation Chapter (How to cite a web site)
1184 Java Utilities Package and Bit Manipulation Chapter 20 Fig. 20.8Demonstrating the bitwise AND, bitwise inclusive OR, bitwise exclusive OR Fig. 20.8 and bitwise complement operators (part 6 of 6). The bitwise inclusive OR operator sets specific bits to 1 in an operand. The second output window for Fig. 20.8 shows the results of combining the value 15and the value 241 by using the bitwise OR operator the result is 255. Figure 20.9 summarizes the results of combining two bits with the bitwise inclusive OR operator. Common Programming Error 20.2 Using the logical OR operator (||) for the bitwise OR operator (|) is a common programming error. The bitwise exclusive OR operator (^) sets each bit in the result to 1 if exactly one of the corresponding bits in its two operands is 1. The third output of Fig. 20.8 shows the results of combining the value 139 and the value 199 by using the exclusive OR operator the result is 76. Figure 20.10 summarizes the results of combining two bits with the bitwise exclusive OR operator. Bit 1 Bit 2 Bit 1 |Bit 2 0 0 0 1 0 1 0 1 1 1 1 1 Fig. 20.9Results of combining two bits with the bitwise inclusive OR operator (|). 20.
Check Tomcat Web Hosting services for best quality webspace to host your web application.