My question would be better understood by the code below. I need to know how last bit set by me. How do I find it in bitset ?
public class FreeMain {
FreeMain ( ) { }
public static void takeBitSet(BitSet bitSet) {
// I intend to read 30 positions from bit set since the for loop looped from 0 to 29.
// Just like list.size() would have given me number of elements added to it
// whats the "list.size()" equivalent for bitset ?
}
public static void main(String[] args) throws IOException {
BitSet bs = new BitSet();
System.out.println(bs.length());
for (int i = 0; i < 30; i++) {
bs.set(i);
System.out.print(bs.get(i));
}
takeBitSet(bs);
}
}