随机获得id的方法

public String generateUUID() {
String uuid = UUID.randomUUID().toString();
uuid = uuid.replace("-", "");
return uuid;

}

原文地址:https://www.cnblogs.com/chengxuyuanIng/p/10518017.html