snippetjavaCritical
Create a GUID / UUID in Java
Viewed 0 times
uuidguidjavacreate
Problem
What are some of the best ways to create a GUID / UUID in Java?
Solution
Have a look at the UUID class bundled with Java 5 and later.
For example:
For example:
- If you want a random UUID you can use the randomUUID method.
- If you want a UUID initialized to a specific value you can use the UUID constructor or the fromString method.
Context
Stack Overflow Q#2982748, score: 396
Revisions (0)
No revisions yet.