import java.util.BitSet;
/**
*
*/
/**
* @author cyh
*
*/
public class BitSetTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
BitSet bitSet1 = new BitSet();
bitSet1.set(0, true);
bitSet1.set(1, true);
bitSet1.set(66, true);
BitSet bitSet2 = new BitSet();
bitSet2.set(0, true);
bitSet2.set(65, true);
// bitSet2.set(1, true);
bitSet1.or(bitSet2);
System.out.println(bitSet1.toString());
System.out.println(bitSet1.length());
System.out.println(bitSet1.get(65));
System.out.println(bitSet1.get(64));
}
}
BitSet位操作
最新推荐文章于 2022-07-20 23:20:41 发布