Skip to content

Instantly share code, notes, and snippets.

@laxman954
Created September 11, 2014 14:39
Show Gist options
  • Save laxman954/2141ff819ff17ccebe9a to your computer and use it in GitHub Desktop.
Save laxman954/2141ff819ff17ccebe9a to your computer and use it in GitHub Desktop.
Randomly Generate Unique Id using UUID -Java
import java.util.UUID;
/**
* @author lekshmana.murugan
* @since 2014-09-11 This RandomIDGeneration class Generate Unique id using UUID class is in
* util pacakage in Java Since version 1.5
* @see http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html
*/
public class RandomIDGeneration {
/**
* This method is used to Generate random unique id
* @return Randomly generate unique id, and converted into string.
*/
public String generateRandomID() {
return UUID.randomUUID().toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment