Here you can find the source of randomChar()
private static char randomChar()
//package com.java2s; //License from project: Open Source License public class Main { private static char randomChar() { int num = (int) Math.floor(Math.random() * 60); if (num < 26) return (char) ((int) 'a' + num); num -= 26;//from www . j av a2 s . c o m if (num < 26) return (char) ((int) 'A' + num); num -= 26; if (num < 1) return '\n'; return ' '; } }