Java BitSet size() methodThe size() method of Java BitSet class returns the total number of bit space actually in use by this BitSet to represent bit values. The maximum element in the set is the size - 1st element. The default size of the bit set is 64-bit space. If the bit is set at index larger than the current BitSet size, it increases its bit space in the multiplication of 64*n, where n starts from 1, 2, 3, so on. Syntax:Parameter:NA Returns:This method returns the number of bits space currently in this bit set. Exception:NA Compatibility Version:Java 1.0 and above Example 1Output: bitset1: {1, 2, 4, 63} bitset2: {10, 20, 30, 40, 64} size of bitset1: 64 size of bitset2: 128 Next TopicJava-bitset-set-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