Generate random uppercase letter

Using ASCII range for uppercase letters, we will generate a random number between 65 and 90. Taking a limit of a stream then converting ASCII char to a string we will generate a random uppercase letter in java 8.

Java 8

@Test
public void random_uppercase_java8() {

    Random random = new Random();
    random.ints(65, 90).limit(10)
            .forEach(a -> System.out.println(Character.toString((char) a)));
    
}