Java examples for java.util:Random String
generate Random Alpha Numeric
//package com.java2s; import java.util.UUID; public class Main { public static void main(String[] argv) throws Exception { boolean isShort = true; System.out.println(generateRandomAlphaNumeric(isShort)); }//from www . j a v a2 s . com public static String generateRandomAlphaNumeric(boolean isShort) { String uuid = UUID.randomUUID().toString(); if (isShort) { uuid = uuid.substring(1, 6); } return uuid; } }