public class UniqueStringGenerator
{
private UniqueStringGenerator()
{
}
public static synchronized String getUniqueString()
{
if(generateCount >
generateCount =
String uniqueNumber = Long
generateCount++;
return uniqueNumber;
}
private static final int MAX_GENERATE_COUNT =
private static int generateCount =
}
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28152.html