get Unique Cid via UUID - Java java.util

Java examples for java.util:UUID

Description

get Unique Cid via UUID

Demo Code


//package com.java2s;
import java.util.UUID;

public class Main {
    public static void main(String[] argv) throws Exception {
        System.out.println(getUniqueCid());
    }/*  www.j a va  2s  . c o m*/

    private static long salt = 0;

    public static String getUniqueCid() {
        salt++;
        return UUID.randomUUID().toString() + String.valueOf(salt);
    }
}

Related Tutorials