Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerShiftRightExample3{ public static void main (String[] args) { // create 2 BigInteger object BigInteger big1,big2; // assign value to big1 big1= new BigInteger("1"); // 0001 // perform shift right operation on big1 // assume n is 2 big2= big1.shiftRight(4); // 0000 String str = " Shift Right operation on " + big1+ " , 4 times gives " + big2; System.out.println(str); } }
Output