Answers for "pick random value from enum"

0

return random from enum

//Return a random int number between min [inclusive] and max [inclusive] 
//Make sure maxNumber does not exceed number of enum values
(EnumType)Random.Range(minNumber, maxNumer);
Posted by: Guest on June-21-2020
-1

get random number from enum in java

return Letter.values()[new Random().nextInt(Letter.values().length)];
Posted by: Guest on May-03-2020

Code answers related to "pick random value from enum"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language