Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerMaxExample2{ public static void main(String[] args){ // create 3 BigInteger objects BigInteger big1,big2,big3; big1= new BigInteger("100"); big2= new BigInteger("10"); // assign the max value of big1,big2 to big3 big3= big1.max(big2); String str="Maximum value among "+ big1+" and "+big2+" is "+big3; System.out.println(str); } }
Output