Answers for "retrieving random strings from an array"

0

get raondom from array java

public static int getRandom(int[] array) {
    int rnd = new Random().nextInt(array.length);
    return array[rnd];
}
Posted by: Guest on June-04-2020
0

get random element from string array java

String[] fruits = {"Apple","Mango","Peach","Banana","Orange","Grapes","Watermelon","Tomato"};
Posted by: Guest on January-06-2021

Code answers related to "retrieving random strings from an array"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language