Solved

Assume the Following Variable Has Been Declared and Given a Value

Question 69

Multiple Choice

Assume the following variable has been declared and given a value as shown: Random rand = new Random() ;
Which of the following will generate a random integer in the range - 20 to 20, inclusive, where each value has an equal chance of being generated?


A) rand.nextInt (-20, 20)
B) rand.nextInt(20) - 41
C) rand.nextInt (-20) + 40
D) rand.nextInt(41) - 20

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents