BitSet: length()
int length()
- Returns the "logical size" of this BitSet: the index of the highest set bit in the BitSet plus one.
import java.util.BitSet;
public class Main {
public static void main(String args[]) {
BitSet bites = new BitSet();
bites.set(0);
bites.set(1);
bites.set(2);
bites.set(3);
System.out.println(bites.size());
System.out.println(bites.length());
}
}