Table of Content

How to perform logical AND operation on BitSet in Java ?


Declaration :

Explanation :

Purpose The and(BitSet set) method performs a logical AND of this target bit set with the argument bit set. This bit set is modified so that each bit in it has the value true if and only if it both initially had the value true and the corresponding bit in the bit set argument also had the value true.
Parameters set ===> a bit set
Return Value This method does not return a value.
Exception NA

Java Program : Example

Below example will explain java.util.BitSet.and() method.

Output of Program :