Java Random Char getRandomChar()

Here you can find the source of getRandomChar()

Description

get Random Char

License

Apache License

Declaration

private static String getRandomChar() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Random;

public class Main {
    private static String[] chars = new String[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
            "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7",
            "8", "9" };

    private static String getRandomChar() {
        Random i = new Random();
        return chars[i.nextInt(chars.length)];
    }/*from www . j av a2 s .  c  o  m*/
}

Related

  1. createRandomChar()
  2. getRandomChar()
  3. getRandomChar()
  4. getRandomChar(boolean number, boolean lower, boolean upper, boolean other, String extra, Random _random)
  5. getRandomChar(int size)
  6. getRandomChar(int x)