Answers for "how can i get random enum in java"

1

java choose random enum

return yourEnum.values()[new Random().nextInt(yourEnum.values().length)];
Posted by: Guest on May-12-2021
-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 "Java"

Java Answers by Framework

Browse Popular Code Answers by Language