Here you can find the source of randomAlphanumericString(int length)
public static String randomAlphanumericString(int length)
//package com.java2s; //License from project: Open Source License public class Main { public static String randomAlphanumericString(int length) { String set = "abcdefghijklmnopqrstuwxyz0123456789"; StringBuilder builder = new StringBuilder(); for (int i = 0; i < length; i++) { builder.append(set.charAt(randomNumber(0, set.length()))); }/*from w w w. ja va2s . c o m*/ return builder.toString(); } public static int randomNumber(int a, int b) { return a + (int) (Math.random() * (b - a)); } }