How do I generate UUID / GUID?
Category: java.util, viewed: 6576 time(s).
UUID / GUID (Universally / Globally Unique IDentifier) are frequently use in programming. Some of its usage are for creating random file names, session id in web application, transaction id and for record's primary keys in database replacing the sequence or auto generated number.
To generate UUID in Java we can use the java.util.UUID class. This class was introduced in JDK 1.5
The result of our program is:
Random UUID String = 7dc53df5-703e-49b3-8670-b1c468f47f1f UUID version = 4 UUID variant = 2
Can't find what you are looking for? Join our FORUMS and ask some questions!
Download Hundreds of Complimentary Industry Resources
Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more;
all available at no cost to you. With more than 600 complimentary offers, you'll find
plenty of titles to suit your professional interests and needs.
Click Here and Sign up today!
