The random numbers would have to be in the range of the array of course. 0-array.length -1