Java UUID generate random ID
import java.util.UUID; public class Main { public static void main(String[] args) { //from w ww. ja va 2 s . c o m System.out.println(UUID.randomUUID().toString()); } }