Skip to content

Instantly share code, notes, and snippets.

@moznion
Created March 18, 2015 15:15
Show Gist options
  • Save moznion/056a652349e6e0912ed8 to your computer and use it in GitHub Desktop.
Save moznion/056a652349e6e0912ed8 to your computer and use it in GitHub Desktop.
enum LowerCaseLetter {
a, b, c;
private static final List<LowerCaseLetter> VALUES = Arrays.asList(values());
private static final int SIZE = VALUES.size();
private static final Random RANDOM = new Random();
public static String getRandomLetter() {
return VALUES.get(RANDOM.nextInt(SIZE)).toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment