Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerAndNotExample1 { public static void main(String[] args){ // create 3 BigInteger objects BigInteger big1, big2 , big3; // assign values to big1, big2 big1= new BigInteger("7"); // 0111 big2 =new BigInteger("4"); // 0100 //perform andNot operation on big1 using big2 big3= big1.andNot(big2); // 0011 String str="Result of andNot operation is "+ big3; System.out.println(str);//print big3 value } }
Output