Here you can find the source of getRandomStr()
protected static String getRandomStr()
//package com.java2s; import java.util.Random; public class Main { protected static String getRandomStr() { String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; Random random = new Random(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < 16; i++) { int number = random.nextInt(base.length()); sb.append(base.charAt(number)); }/*ww w . jav a 2s .co m*/ return sb.toString(); } }