BigInteger a=new BigInteger("1234"); BigInteger b=new BigInteger("3"); BigInteger result=a.mod(b); System.out.println(result);