Java tutorial
//package com.java2s; import java.util.Random; public class Main { public static String generateRandomString(int len) { String str = "0123456789abcdefghijklmnopqrstuvwxyz"; Random rnd = new Random(); StringBuilder sb = new StringBuilder(len); for (int i = 0; i < len; i++) { sb.append(str.charAt(rnd.nextInt(str.length()))); } return sb.toString(); } }