Java BitSet and() methodThe and() method of Java BitSet class is used to perform a logical AND operation of this target bit set with the specified set argument. The value of bit set is true if and only if the bit set of both initially and the corresponding bit argument has the true value. Syntax:Parameter:
Returns:NA Exception:NullPointerException - If null parameter will pass in the method. Compatibility Version:Java 1.0 and above Example 1Output: bitset1: {0, 1, 2, 3, 4} bitset2: {2, 4, 6, 8, 10} result bitset: {2, 4} Example 2The BitSet class converts the character into a byte value. Output: bitset1: {4, 5, 97, 98, 99} bitset2: {3, 4, 6, 97, 98} result bitset: {4, 97, 98} Next TopicJava-instant-query-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