Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerNextProbablePrimeExample2{ public static void main(String[] args){ // create 2 BigInteger object BigInteger big1,big2; // assign value to big1 big1= new BigInteger("-23"); // assign nextProbablePrime of big1 to big2 big2= big1.nextProbablePrime(); String str =" Next Probable prime after "+ big1+ " is "+ big2; System.out.println(str); } }
Output