Write code to declare and instantiate an object of the Random class (call the object reference variable

Question:

Write code to declare and instantiate an object of the Random class (call the object reference variable rand). Then write a list of expressions using the nextInt method that generate random numbers in the following specified ranges, including the endpoints. Use the version of the nextInt method that accepts a single integer parameter.

a. 0 to 10

b. 0 to 400

c. 1 to 10

d. 1 to 400

e. 25 to 50

f. –10 to 15

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Java Software Solutions

ISBN: 9789353063610

9th Edition

Authors: John Lewis, William Loftus

Question Posted: