Returns a random lower case letter [ a-z ]. - Android java.util

Android examples for java.util:Random String

Description

Returns a random lower case letter [ a-z ].

Demo Code


//package com.java2s;

import java.util.Random;

public class Main {
    /**// w  w  w .  j a  v  a 2 s . c om
     * Returns a random lower case letter [ a-z ].
     */
    public static char randomLetterLcase() {
        Random r = new Random();
        return (char) (r.nextInt(26) + 'a');
    }
}

Related Tutorials