Here you can find the source of getRandomChar()
public static String getRandomChar()
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { public static String getRandomChar() { Random random = new Random(); // Generates four random numbers, to generate a number, write a String[] s = { "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; String rand = ""; if (random.nextBoolean()) { rand = String.valueOf(random.nextInt(10)); } else {// w w w . ja v a 2 s .co m int index = random.nextInt(25); rand = s[index]; } return rand; } }