Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A Java program to create a Randomly Generated UUID i.e. Version 4 UUID. Read blog at coderolls.com/create-uuid-in-java
import java.util.UUID;
/**
* A Java program to create a Randomly Generated UUID i.e. Version 4 UUID
* @author Gaurav Kukade at coderolls.com
*
*/
public class CreateUUID {
public static void main(String[] args) {
// creating random uuid i.e. version 4 UUID
UUID uuid = UUID.randomUUID();
System.out.println("Printing the randomly generated UUID value......\n");
System.out.println("uuid: "+uuid);
}
}
@gauravkukade

This comment has been minimized.

Copy link
Owner Author

@gauravkukade gauravkukade commented Dec 24, 2020

Output:

Printing the randomly generated UUID value......

uuid: e3aed661-ccc2-42fd-ad69-734fee350cd2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment