Java tutorial
import java.math.BigInteger; public class Main { public static void main(String[] args) { BigInteger bi1 = new BigInteger("6"); BigInteger bi2 = new BigInteger("3"); // compare bi1 with bi2 int res = bi1.compareTo(bi2); String str1 = "Both values are equal "; String str2 = "First Value is greater "; String str3 = "Second value is greater"; if (res == 0) System.out.println(str1); else if (res == 1) System.out.println(str2); else if (res == -1) System.out.println(str3); } }