Here you can find the source of genRandomString(int len)
public static String genRandomString(int len)
//package com.java2s; //License from project: Apache License import java.util.UUID; public class Main { public static String genRandomString() { return genRandomString(6); }/*from ww w. j av a 2 s .co m*/ public static String genRandomString(int len) { return UUID.randomUUID().toString().replaceAll("-", "").toUpperCase().substring(0, len); } }