Bit Set Operations : BitSet « Collections « Java Tutorial






public void set(int position)
public void clear(int position)
public boolean get(int position)
import java.util.BitSet;

public class MainClass {
  public static void main(String args[]) {
    BitSet bites = new BitSet();
    bites.set(0);
    bites.set(1);
    bites.set(2);
    bites.set(3);
    System.out.println(bites);
  }
}
{0, 1, 2, 3}








9.49.BitSet
9.49.1.Bit Set Operations
9.49.2.Manipulating Sets of Bits
9.49.3.Determining Set Size
9.49.4.Cloning Bit Sets
9.49.5.Set value to BitSet and then do AND, OR and XOR actions
9.49.6.Use BitSet to mark holiday