Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerFlipBitExample2 { public static void main(String[] args){ // create 2 BigIntegerobject BigInteger big1,big2; // assign value to big1 big1= new BigInteger("5"); // 0101 // perform flipbit operation on big1 with index -1 big2= big1.flipBit(-1); String str="FlipBit operation on " +big1+ " at index -1 gives "+ big2; System.out.println(str); } }
Output