Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerHashCodeExample1{ public static void main(String[] args){ // create 2 BigInteger objects BigInteger big1= new BigInteger("123"); BigInteger big2= new BigInteger("1234567"); // get the hash code of BigIntegers int hashCode1= big1.hashCode(); int hashCode2= big2.hashCode(); String str1=" Hash code of "+big1+" is "+hashCode1; String str2=" Hash code of "+big2+" is "+ hashCode2; System.out.println(str1); System.out.println(str2); } }
Output