For the specific problem you were talking about: when you called bits2.set(1000001) , you set the millionth and first bit to true. Then, when you crossed paths with bits1 , in which one million, 111 thousand and 111-bit bits were set, they had no bits.
I think what you wanted to do is
bits2.set(0); // set the 0th bit bits2.set(6); // set the 6th bit
Does this help clarify the situation?
Louis Wasserman Feb 17 '12 at 7:21 2012-02-17 19:21
source share