Friday, April 22, 2016

Create a GUID in Java

Some software development tasks need a way to generate unique identifiers. I saw several homegrown solutions, but Java 5 makes the process a breeze. It contains class UUID which can generate type 4 (pseudo randomly generated) unique identifiers. Here is a simple example:
package net.softwaregeek;

import java.util.UUID;

public class UUIDMain {
    public static void main(final String[] args) {
        System.out.println(UUID.randomUUID());
    }
}
The code is self-explanatory. It generates a unique identifier and prints it to console. Class UUID contains several other useful methods which I encourage you to explore on your own.

57 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog...Java Training in Chennai
    Java Training Institute in Chennai

    ReplyDelete
  3. It's interesting that many of the bloggers to helped clarify a few things for me as well as giving. Most of ideas can be nice content. The people to give them a good shake to get your point and across the command.
    oracle training in chennai|| hadoop training in chennai

    ReplyDelete
  4. Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating.
    oracle training in chennai|| hadoop training in chennai

    ReplyDelete
  5. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
    Regards,
    hadoop training in chennai || selenium training in chennai




    ReplyDelete
  6. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
    big-data-hadoop-training-institute-in-bangalore

    ReplyDelete
  7. Very good informative article. Thanks for sharing such nice article, keep on up dating such good articles.

    Internet Of Things Services | Austere Technologies

    ReplyDelete
  8. wow...nice blog, very helpful information. Thanks for sharing.

    Mobilty Services | Austere Technologies

    ReplyDelete
  9. Great article, really very helpful content you made. Thank you, keep sharing.

    Digital Transformation Services | Austere Technologies

    ReplyDelete
  10. Nice blog with excellent information. Thank you, keep sharing.

    Cloud Services | Austere Technologies

    ReplyDelete
  11. VERY INFORMATIVE BLOG. KEEP SHARING SUCH A GOOD ARTICLES.

    Best Software Company | Austere Technologies

    ReplyDelete
  12. Really great blog, it's very helpful and has great knowledgeable information. Thanks for sharing.

    Best Quality Managment Services | Austere Technologies

    ReplyDelete
  13. your tutorials are very nice explanation and also visit for a real time training for Java Training in Chennai | Best Java Training Institute in Chennai | Java Master Program Training in Chennai

    ReplyDelete
  14. This is the best place where we can get good collection of information with an excellent explanation, thanks much for sharing the useful info do keep on sharing...
    Best Online Software Training Institute | Advanceed Java Training

    ReplyDelete
  15. Great article, really very helpful content you made. Thank you, keep sharing.
    Summer Course Training in Chennai | Summer Course Training in Madipakkam

    ReplyDelete
  16. Really great blog, it's very helpful and has great knowledgeable information. Thanks for sharing.
    Summer Course Training in Chennai | Summer Course Training in Velachery

    ReplyDelete
  17. Another interesting article.I am amazed.Thanks, I really appreciate the kind words.
    OCJP Exam Center in Chennai | OCJP Exam Center in Velachery

    ReplyDelete
  18. VERY INFORMATIVE BLOG. KEEP SHARING SUCH A GOOD ARTICLES.

    Best Cloud Solutions | Austere Technologies

    ReplyDelete
  19. Awesome post. Really you are shared very informative concept... Thank you for sharing. Keep on updating...
    Python Courses Certifications Training in Chennai | Excellent Python Classes in Saidapet

    ReplyDelete
  20. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
    Cisco Certifications Coaching Center in Chennai | Best Cisco Courses in Chromepet

    ReplyDelete
  21. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    ISTQB Certifications Course in Chennai | QA Testing in Medavakkam

    ReplyDelete
  22. Great blog! Really awesome I got more information from this blog. Thanks for sharing with us
    Java Training in Chennai | Java Training Institute in Chennai

    ReplyDelete
  23. Hi Thanks for the nice information its very useful to read your blog. We provide Software Development Services

    ReplyDelete
  24. AWS Training in Bangalore - Live Online & Classroom
    myTectra Amazon Web Services (AWS) certification training helps you to gain real time hands on experience on AWS. myTectra offers AWS training in Bangalore using classroom and AWS Online Training globally. AWS Training at myTectra delivered by the experienced professional who has atleast 4 years of relavent AWS experince and overall 8-15 years of IT experience. myTectra Offers AWS Training since 2013 and retained the positions of Top AWS Training Company in Bangalore and India.


    IOT Training in Bangalore - Live Online & Classroom
    IOT Training course observes iot as the platform for networking of different devices on the internet and their inter related communication. Reading data through the sensors and processing it with applications sitting in the cloud and thereafter passing the processed data to generate different kind of output is the motive of the complete curricula. Students are made to understand the type of input devices and communications among the devices in a wireless media.

    ReplyDelete
  25. Hi Thanks for the nice information its very useful to read your blog. We provide best SYSTEM INTEGRATION SERVICES

    ReplyDelete
  26. Thank you for sharing this valuable information. But get out this busy life and find some peace with a beautiful trip. book Andaman Nicobar Tour Packages @ 11599

    ReplyDelete
  27. Thank you for sharing this valuable information. But get out this busy life and find some peace with a beautiful trip. book Andaman Family Tour Packages @ 40999/-

    ReplyDelete
  28. Thank you for sharing this valuable information. But get out this busy life and find some peace with a beautiful trip. book ANDAMAN TOUR PACKAGE@14599/

    ReplyDelete
  29. Nice blog..! I really loved reading through this article. Thanks for sharing such
    an amazing post with us and keep blogging... Java Training in Chennai | RPA Training in Chennai

    ReplyDelete
  30. Hi Thanks for the nice information its very useful to read your blog. We provide best Find All Isfs Courses

    ReplyDelete
  31. Hi Thanks for the nice information its very useful to read your blog. We provide best Massil Technologies

    ReplyDelete
  32. Thanks for taking time to share this post. It is really useful. Continue sharing more like this.
    Regards,
    Java Training in Chennai | Blue prism Training in Chennai

    ReplyDelete
  33. Hi Thanks for the nice information its very useful to read your blog. We provide best Certified Financial Analyst

    ReplyDelete
  34. Your article gives lots of information to me. Thanks for sharing.
    acca course in hyderabad | ISFS

    ReplyDelete
  35. Thanks for such a nice article on Blueprism.Amazing information of Blueprism you have . Keep sharing and updating this wonderful blog on Blueprism
    Thanks and regards,
    blue prism training in chennai
    blue prism training institute in chennai
    Blueprism certification in chennai

    ReplyDelete
  36. Thanks for sharing a valuable information to us. Thanks for your blog.
    CIMA training institute in Hyderabad | ISFS

    ReplyDelete
  37. In the beginning, I would like to thank you much about this great post. Its very useful and helpful for anyone looking for tips to help him learn and master in Angularjs. I like your writing style and I hope you will keep doing this good working.
    Angularjs Classes in Bangalore
    Angularjs Coaching in Bangalore
    Angularjs Institute in Bangalore
    Android Classes in Bangalore
    Android Development Training in Bangalore
    Android Development Course in Bangalore

    ReplyDelete
  38. Awwsome informative blog ,Very good information thanks for sharing such wonderful blog with us ,after long time came across such knowlegeble blog. keep sharing such informative blog with us. Aviation Courses in Chennai | Best Aviation Academy in Chennai | Aviation Academy in Chennai | Aviation Training in Chennai | Aviation Institute in Chennai

    ReplyDelete
  39. This comment has been removed by the author.

    ReplyDelete
  40. Nice Post. Looking for more updates from you. Thanks for sharing.

    businessexceltemplates
    Technology

    ReplyDelete
  41. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.Trending Software Technologies in 2018 | Hadoop Training in Chennai | big data Hadoop training and certification in Chennai | Roles and reponsibilities of hadoop developer

    ReplyDelete