BitSethas a static method valueOf(long[])that
Returns a new bit containing all the bits in the specified long array.
So, an array with one long will have 64 bits, an array with two lengths will have 128 bits, etc.
If you need to get BitSetfrom only one value int, use it like this:
Integer value = 42;
System.out.println(Integer.toBinaryString(value));
BitSet bitSet = BitSet.valueOf(new long[] { value });
System.out.println(bitSet);
He is typing
101010
{1, 3, 5}
In other words, the 2nd, 4th, and 6th bits are set from right to left in the above representation.