Java compare BigInteger values In this Java core tutorial we learn how to use the java.math.BigInteger.compareTo() method to compare two BigInteger objects.