All About Class BitSet in Java

Java BitSet implements a vector of bits that grows as needed.Each component of the BitSet has a boolean value.The bits of a BitSet represents non negative integers.Individual bits can be examined,set or cleared. By default all bits in the BitSet initially have the value false.Every bit set has current size ,which is the number of bits currently in the BitSet.
The class BitSet  is defined as:

public final class java.util.BitSet extends java.lang.Object implements java.lang.Cloneable{
public BitSet()//Creates an empty BitSet whose bits are initially false.
public BitSet (int nBits)////Creates an empty BitSet with size nBits the specific number of bits.whose bits are initially false.
public void and(Bitset set);
public void clear(int bits);
public void or(Bitset set);
public void set(int bits);
public void xor(Bitset set);
public Object clone();
public boolean equals(Object obj);
public boolean get(int bit);
public int hashCode();
public int size();
public String toString();
All About Class BitSet in Java All About Class BitSet in Java Reviewed by Animesh Chatterjee on October 03, 2018 Rating: 5

No comments:

Powered by Blogger.