AndNot operation on BigInteger in Java
Description
The following code shows how to andNot operation on BigInteger.
Example
/*from w ww.java 2 s . c o m*/
import java.math.BigInteger;
public class Main {
public static void main(String[] argv) throws Exception {
byte[] bytes = new byte[] { 0x1, 0x00, 0x00 };
BigInteger bi = new BigInteger(bytes);
System.out.println(bi);
bi = bi.andNot(bi);
System.out.println(bi);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »