Question: Assume that numList is a 1 D array that has been correctly constructed and populated with int values. Which of the following expressions produces a

Assume that numList is a 1D array that has been correctly constructed and populated with int values.
Which of the following expressions produces a valid random index for numList?
A.(int)(Math.random()* numList.length)-1
B.(int)(Math.random()* numList.length)
C.(int)(Math.random()* numList.length)+1
D.(int)(Math.random()*(numList.length +1))
E. Math.random(numList.length)

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!