Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

random object of array java

public static int getRandom(int[] array) {
    int rnd = new Random().nextInt(array.length);
    return array[rnd];
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #random #object #array #java
ADD COMMENT
Topic
Name
3+4 =