Java BitSet length() methodThe length() method of Java BitSet class returns the "logical size" of this BitSet. The length of BitSet goes up to the index of the highest set bit plus one. It returns zero if the BitSet does not contain any set bit. Syntax:Parameter:NA Returns:The length() method returns the logical size of this BitSet. Exception:NA Compatibility Version:Java 1.2 and above Example 1Output: bitset1: {} bitset2: {1, 2, 3, 4} bitset3: {2, 4, 6, 8, 10, 12} length of bitset1: 0 length of bitset2: 5 length of bitset3: 13 Next TopicJava-bitset-isempty-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India