Java BitSet stream() methodThe stream() method of Java BitSet class returns a stream of indices for which the current BitSet contains a bit. The return indices of bit are set to true value in the bit set and follow an increasing order. The size of stream refers to the total number of bits are set to true and it is equal to the value returned by the cardinality() method. Syntax:Parameter:NA Returns:The stream() method returns a stream of indices for which the current BitSet contains a bit. Exception:NA Compatibility Version:Java 1.8 and above Example 1Output: bitset: {0, 1, 3, 5, 6} stream of indices: [email protected] size of stream1: 5 bitset1: {0, 1, 3, 5} stream of indices1: [email protected] size of stream2: 4 Next TopicJava-bitset-size-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