Question: THIS JAVA PROGRAM KEEPS COMING WITH A ERROR MESSAGE WHEN I RUN CAN YOU FIX IT? import java.math.*; import java.util.Random; import java.util.Scanner; public class GFG

THIS JAVA PROGRAM KEEPS COMING WITH A ERROR MESSAGE WHEN I RUN

CAN YOU FIX IT?

import java.math.*;

import java.util.Random;

import java.util.Scanner;

public class GFG {

public static void main(String[] args)

{

Scanner sc = new Scanner(System.in);

BigInteger biginteger; //big integer

int length = 4; //makes a integer value

Random random = new Random(); //rasndom object

biginteger = BigInteger.probablePrime(length, random); // calls proabable prime to see what the next probable prime can be

String result = "ProbablePrime whose bit length is "

+ length + " = " + biginteger;

System.out.println(result); //print results

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!