In this java sample will show how to generate a random vowel. A vowel is represented in English language by A, E, I, O, U, and sometimes Y. If you are building a guessing game which generates a random character this java or java 8 snippet should help.
Straight up Java
Using a similar technique we saw in how to generate arbitrary lowercase letter we will create a char array with vowels. Next choosing a random number between one and the size of the char array we can pick based on the number chosen. Finally output a stream by using a for loop we will see the results.