Answers for "select a random element from an enum in java"

1

java choose random enum

return yourEnum.values()[new Random().nextInt(yourEnum.values().length)];
Posted by: Guest on May-12-2021

Code answers related to "select a random element from an enum in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language