一个小demo
public class BigIntegerTest {
public static void main(String[] args) {
BigInteger num = new BigInteger("0");
num = num.setBit(2);
num = num.setBit(1);
System.out.println(num);
System.out.println(num.testBit(2));
System.out.println(num.testBit(1));
System.out.println(num.testBit(3));
}
}
网友评论