Here you can find the source of randomString(int length)
private static String randomString(int length)
//package com.java2s; //License from project: LGPL public class Main { private static String randomString(int length) { char[] guts = new char[length]; for (int i = 0; i < length; i++) { guts[i] = Character.toChars(65 + (int) (Math.random() * 26))[0]; }//from ww w . j a v a 2 s . c o m return String.valueOf(guts); } }