Bitset class
The size can be dynamically changed, with a value of true or false for the bit set. Used to represent a set of Boolean flags.
There are three kinds of shift operators in Java
<<: Left shift operator, num << 1, equals num multiplied by 2
>>: Right shift operator, NUM >> 1, equivalent num divided by 2
>>>: Unsigned Right shift, ignore sign bit, empty 0
Why is 1l<<32 in Java equal to 4294967296, while 1<<32 equals 1.
You need to understand the binary storage form of integers and the basic operations of shift operations for integer shifts of type int a<<B, the system first with B to 32 to find the remainder, the result is the true shift of the number of digits for long type integer shift, ibid, but 64 for the remainder of 1L<< +, the actual number of bits moved 32% -= +for 1<< +, the actual number of bits moved 32% +=01L:
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 00011L<< +:0000 0000 0000 0000 0000 0000 0000 0001 0000 0000 0000 0000 0000 0000 0000 0000=2^ +=4294967296 1:
0000 0000 0000 0000 0000 0000 0000 00011<< +:0000 0000 0000 0000 0000 0000 0000 0001=1
Words[wordindex] |= (1L << bitindex);
Equivalent to the Bitindex to 64 for the remainder operation (the left will be round), and then let 1 move to the rest of the array position, and then set this value to True
Drill down into the Java----collection----BitSet