Returns a random upper case letter [ A-Z ]. - Android java.util

Android examples for java.util:Random String

Description

Returns a random upper case letter [ A-Z ].

Demo Code


//package com.java2s;

import java.util.Random;

public class Main {
    /**//from w w w  . j  av a 2  s.  co m
     * Returns a random upper case letter [ A-Z ].
     */
    public static char randomLetterUcase() {
        Random r = new Random();
        return (char) (r.nextInt(26) + 'A');
    }
}

Related Tutorials