Here you can find the source of random(int min, int max)
private static int random(int min, int max)
//package com.java2s; //License from project: Open Source License public class Main { public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyz"; private static int random(int min, int max) { return (int) (Math.random() * max + min); }/*ww w.j a v a 2s . c om*/ public static char random(String str) { return str.charAt(random(0, str.length())); } public static String random(int length) { StringBuilder sb = new StringBuilder(length); for (int i = 0; i < length; ++i) sb.append(random(ALPHABET)); return sb.toString(); } }