Here you can find the source of randomAlpha()
private static char randomAlpha()
//package com.java2s; //License from project: Open Source License public class Main { /**/*w w w . j ava 2s. c o m*/ * Generate a random character from the alphabet - either a-z or A-Z * * @return a random alphabetic character */ private static char randomAlpha() { int i = (int) (Math.random() * 52); if (i > 25) return (char) (97 + i - 26); else return (char) (65 + i); } }