Here you can find the source of generateRandomString(int len)
public static String generateRandomString(int len)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { static final String AB = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; public static Random random = new Random(); public static String generateRandomString(int len) { StringBuilder sb = new StringBuilder(len); for (int i = 0; i < len; i++) sb.append(AB.charAt(random.nextInt(AB.length()))); return sb.toString(); }//from ww w. j av a 2 s.c om }