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

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!