Created
March 18, 2015 15:15
-
-
Save moznion/056a652349e6e0912ed8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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