How to avoid java.lang.OutOfMemoryError?
问题 I have two simple java codes.The first one defines constant power as power = a.pow(b); import java.math.BigInteger; public class FermatOne { public static void main(String[] args) { BigInteger a = new BigInteger ("2"); BigInteger k = new BigInteger ("15"); BigInteger c = new BigInteger ("1"); int b = 332192810; BigInteger n = new BigInteger ("2"); BigInteger power; power = a.pow(b); BigInteger exponent; exponent = k.multiply(power); BigInteger mod; mod = exponent.add(c); BigInteger result = n