Here you can find the source of randomString(int size)
public static String randomString(int size)
//package com.java2s; public class Main { public static String randomString(int size) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < size; i++) { sb.append((char) (((int) 'A') + Math.random() * 25)); }/*from ww w. ja v a2 s . c o m*/ return sb.toString(); } }