Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java get random index from array

private int getRandomIndex(int arrayLength) {
  Random r = new Random();
  return r.nextInt(arrayLength);
}
 
PREVIOUS NEXT
Tagged: #java #random #index #array
ADD COMMENT
Topic
Name
8+7 =