Here you can find the source of generateUUID()
public static String generateUUID()
//package com.java2s; import java.util.UUID; public class Main { public static String generateUUID() { StringBuffer sb = new StringBuffer(); for (int i = 0; i < 8; i++) { sb.append(UUID.randomUUID().toString().split("-")[0]); sb.append(UUID.randomUUID().toString().split("-")[1]); sb.append(UUID.randomUUID().toString().split("-")[2]); sb.append(UUID.randomUUID().toString().split("-")[3]); sb.append(UUID.randomUUID().toString().split("-")[4]); }/*from www . j av a2 s .c om*/ return sb.toString(); } }