1190 Java Utilities Package and Bit Manipulation Chapter (Sex offenders web site)

1190 Java Utilities Package and Bit Manipulation Chapter 20 Bitwise assignment operators &= Bitwise AND assignment operator. |= Bitwise inclusive OR assignment operator. ^= Bitwise exclusive OR assignment operator. <<= Left shift assignment operator. >>= Right shift with sign extension assignment operator. >>>= Right shift with zero extension assignment operator. Fig. 20.12The bitwise assignment operators. 20.12 20.9 BitSetClass Class BitSet makes it easy to create and manipulate bit sets. Bit sets are useful for representing a set of boolean flags. BitSets are dynamically resizable. More bits can be added as needed, and a BitSetobject will grow to accommodate the additional bits. The statement BitSet b = new BitSet(); creates a BitSetthat initially is empty. Also, a program can specify the size of a BitSet with the statement BitSet b = new BitSet( size ); which creates a BitSetwith sizebits. The statement b.set( bitNumber ); sets bit bitNumber on. This makes the underlying value of that bit 1. Note that bit numbers are zero based, like Vectors. The statement b.clear( bitNumber ); sets bit bitNumber off. This makes the underlying value of that bit 0. The statement b.get( bitNumber ); gets the value of bit bitNumber. The result is returned as true if the bit is on, false if the bit is off. The statement b.and( b1 ); performs a bit-by-bit logical AND between BitSets band b1. The result is stored in b. Bitwise logical OR and bitwise logical XOR are performed by the statements b.or( b1 ); b.xor( b2 );
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.

Leave a Reply