Question: Java random number import java.util.Random; public class HelloWorld { public static void main(String[] args) { Random rand = new Random(); int n1 = rand.nextInt(- 821005813);
Java random number
import java.util.Random;
public class HelloWorld
{
public static void main(String[] args)
{
Random rand = new Random();
int n1 = rand.nextInt(- 821005813);
int n2 = rand.nextInt(1728578332);
int n3 = rand.nextInt(); //Need to determine this!
System.out.println(n1);
System.out.println(n2);
System.out.println(n3);
}
}
How can I determine n3 ? Also, passing a negative number in n1 is not possible so how can we solve this question to find out n3?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
